Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preparation for deprecating reactions' user metadata #1556

Merged
merged 9 commits into from
Dec 10, 2024
17 changes: 14 additions & 3 deletions zulipterminal/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1849,9 +1849,20 @@ def _handle_reaction_event(self, event: Event) -> None:
)
else:
for reaction in message["reactions"]:
# Since Who reacted is not displayed,
# remove the first one encountered
if reaction["emoji_code"] == event["emoji_code"]:
reaction_user_id = (
reaction["user"]["id"]
if "user" in reaction
else reaction["user_id"]
)
event_user_id = (
event["user"]["user_id"]
if event.get("user") and isinstance(event["user"], dict)
else event["user_id"]
)
if (
reaction["emoji_code"] == event["emoji_code"]
and reaction_user_id == event_user_id
):
message["reactions"].remove(reaction)
break
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feature level 3.0 is old enough that we could drop support for it. But I guess this is OK.


Expand Down