mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 01:16:19 +00:00
api: Improve consistency of reactions API.
Previously, the message and event APIs represented the user differently for the same reaction data. To make this more consistent, I added a user_id field to the reaction dict for both messages and events. I updated the front end to use the user_id field rather than the user dict. Lastly, I updated front end and back end tests that used user info. I primarily tested this by running my local Zulip build and adding/removing reactions from messages. Fixes #12049.
This commit is contained in:
@@ -1670,6 +1670,10 @@ def notify_reaction_update(user_profile: UserProfile, message: Message,
|
||||
event: Dict[str, Any] = {
|
||||
'type': 'reaction',
|
||||
'op': op,
|
||||
'user_id': user_profile.id,
|
||||
# TODO: We plan to remove this redundant user_dict object once
|
||||
# clients are updated to support accessing use user_id. See
|
||||
# https://github.com/zulip/zulip/pull/14711 for details.
|
||||
'user': user_dict,
|
||||
'message_id': message.id,
|
||||
'emoji_name': reaction.emoji_name,
|
||||
|
||||
Reference in New Issue
Block a user