diff --git a/lib/types/message-types.js b/lib/types/message-types.js --- a/lib/types/message-types.js +++ b/lib/types/message-types.js @@ -125,6 +125,7 @@ SIDEBAR_SOURCE: 17, // Appears in the newly created sidebar CREATE_SIDEBAR: 18, + REACTION: 19, }); export type MessageType = $Values; export function assertMessageType(ourMessageType: number): MessageType { @@ -147,7 +148,8 @@ ourMessageType === 15 || ourMessageType === 16 || ourMessageType === 17 || - ourMessageType === 18, + ourMessageType === 18 || + ourMessageType === 19, 'number is not MessageType enum', ); return ourMessageType; @@ -217,6 +219,16 @@ +time: number, +sourceMessage?: RawComposableMessageInfo | RawRobotextMessageInfo, }; + +export type ReactionMessageData = { + +type: 19, + +threadID: string, + +creatorID: string, + +time: number, + +targetMessageID: string, + +reaction: string | null, +}; + export type MessageData = | TextMessageData | CreateThreadMessageData @@ -235,7 +247,8 @@ | MediaMessageData | UpdateRelationshipMessageData | SidebarSourceMessageData - | CreateSidebarMessageData; + | CreateSidebarMessageData + | ReactionMessageData; export type MultimediaMessageData = ImagesMessageData | MediaMessageData; @@ -266,10 +279,17 @@ ...SidebarSourceMessageData, id: string, }; + +export type RawReactionMessageInfo = { + ...ReactionMessageData, + id: string, +}; + export type RawMessageInfo = | RawComposableMessageInfo | RawRobotextMessageInfo - | RawSidebarSourceMessageInfo; + | RawSidebarSourceMessageInfo + | RawReactionMessageInfo; export type LocallyComposedMessageInfo = | ({