diff --git a/lib/actions/message-actions.js b/lib/actions/message-actions.js --- a/lib/actions/message-actions.js +++ b/lib/actions/message-actions.js @@ -196,6 +196,12 @@ }; }; +const sendReactionMessageActionTypes = Object.freeze({ + started: 'SEND_REACTION_MESSAGE_STARTED', + success: 'SEND_REACTION_MESSAGE_SUCCESS', + failed: 'SEND_REACTION_MESSAGE_FAILED', +}); + const saveMessagesActionType = 'SAVE_MESSAGES'; const processMessagesActionType = 'PROCESS_MESSAGES'; const messageStorePruneActionType = 'MESSAGE_STORE_PRUNE'; @@ -213,6 +219,7 @@ sendMultimediaMessageActionTypes, sendMultimediaMessage, legacySendMultimediaMessage, + sendReactionMessageActionTypes, saveMessagesActionType, processMessagesActionType, messageStorePruneActionType, 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 @@ -526,6 +526,15 @@ +interface: CallServerEndpointResultInfoInterface, }; +export type SendReactionMessagePayload = { + +targetMessageID: string, + +serverID: string, + +threadID: string, + +time: number, + +interface: CallServerEndpointResultInfoInterface, + +newMessageInfos: $ReadOnlyArray, +}; + export type SendTextMessageRequest = { +threadID: string, +localID?: string, diff --git a/lib/types/redux-types.js b/lib/types/redux-types.js --- a/lib/types/redux-types.js +++ b/lib/types/redux-types.js @@ -38,8 +38,10 @@ import type { MessageStore, RawMultimediaMessageInfo, + RawReactionMessageInfo, FetchMessageInfosPayload, SendMessagePayload, + SendReactionMessagePayload, SaveMessagesPayload, NewMessagesPayload, MessageStorePrunePayload, @@ -522,6 +524,25 @@ +payload: SendMessagePayload, +loadingInfo: LoadingInfo, } + | { + +type: 'SEND_REACTION_MESSAGE_STARTED', + +loadingInfo?: LoadingInfo, + +payload: RawReactionMessageInfo, + } + | { + +type: 'SEND_REACTION_MESSAGE_FAILED', + +error: true, + +payload: Error & { + +targetMessageID: string, + +threadID: string, + }, + +loadingInfo?: LoadingInfo, + } + | { + +type: 'SEND_REACTION_MESSAGE_SUCCESS', + +payload: SendReactionMessagePayload, + +loadingInfo: LoadingInfo, + } | { +type: 'SEARCH_USERS_STARTED', +payload?: void,