Skip to content

Commit de9a04f

Browse files
Niloth-ptimabbott
authored andcommitted
api_types/model: Add support for user_id in reaction events.
1 parent 95a5b0e commit de9a04f

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

zulipterminal/api_types.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,8 @@ class UpdateMessagesLocationEvent(BaseUpdateMessageEvent):
408408
class ReactionEvent(TypedDict):
409409
type: Literal["reaction"]
410410
op: str
411-
user: Dict[str, Any] # 'email', 'user_id', 'full_name'
411+
user_id: NotRequired[int] # Added in Zulip v3.0, ZFL 2 replacing 'user'
412+
user: NotRequired[Dict[str, Any]] # 'email', 'user_id', 'full_name'
412413
reaction_type: EmojiType
413414
emoji_code: str
414415
emoji_name: str

zulipterminal/model.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1838,7 +1838,13 @@ def _handle_reaction_event(self, event: Event) -> None:
18381838
message["reactions"].append(
18391839
{
18401840
key: event.get(key)
1841-
for key in ["user", "reaction_type", "emoji_code", "emoji_name"]
1841+
for key in [
1842+
"user",
1843+
"reaction_type",
1844+
"emoji_code",
1845+
"emoji_name",
1846+
"user_id",
1847+
]
18421848
}
18431849
)
18441850
else:

0 commit comments

Comments
 (0)