Skip to content

Commit f24cc47

Browse files
committed
api: On reaction events, stop assuming old user object is present
The `user_id` field has been present in reaction events since Zulip 3.0 (FL 2), which is below our kMinAllowedServerVersion (4.0). See API docs: https://zulip.com/api/get-events#reaction-add https://zulip.com/api/get-events#reaction-remove Fixes: zulip#5911
1 parent a115df1 commit f24cc47

File tree

2 files changed

+0
-11
lines changed

2 files changed

+0
-11
lines changed

src/api/modelTypes.js

-3
Original file line numberDiff line numberDiff line change
@@ -719,9 +719,6 @@ export type ReactionType = 'unicode_emoji' | 'realm_emoji' | 'zulip_extra_emoji'
719719

720720
/**
721721
* An emoji reaction to a message.
722-
*
723-
* The raw JSON from the server may have a different structure, but we
724-
* normalize it to this form.
725722
*/
726723
export type Reaction = $ReadOnly<{|
727724
user_id: UserId,

src/events/eventToAction.js

-8
Original file line numberDiff line numberDiff line change
@@ -341,14 +341,6 @@ export default (state: PerAccountState, event: $FlowFixMe): EventAction | null =
341341
case 'reaction':
342342
return {
343343
...event,
344-
345-
// Raw reaction events from the server have a variation on the
346-
// properties of `Reaction`: instead of `user_id: UserId`, they have
347-
// `user: {| email: string, full_name: string, user_id: UserId |}`.
348-
// NB this is different from the reactions in a `/messages` response;
349-
// see `getMessages` to compare.
350-
user_id: event.user.user_id,
351-
352344
type: opToActionReaction[event.op],
353345
};
354346

0 commit comments

Comments
 (0)