Page MenuHomePhabricator

D7139.diff
No OneTemporary

D7139.diff

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
@@ -5,8 +5,10 @@
import type {
FetchMessageInfosPayload,
SendMessageResult,
+ SendEditMessageResult,
SendReactionMessageRequest,
SimpleMessagesPayload,
+ SendEditMessageRequest,
} from '../types/message-types.js';
import type { MediaMessageServerDBContent } from '../types/messages/media.js';
import type {
@@ -244,6 +246,19 @@
success: 'SEND_EDIT_MESSAGE_SUCCESS',
failed: 'SEND_EDIT_MESSAGE_FAILED',
});
+const sendEditMessage =
+ (
+ callServerEndpoint: CallServerEndpoint,
+ ): ((request: SendEditMessageRequest) => Promise<SendEditMessageResult>) =>
+ async request => {
+ const response = await callServerEndpoint('edit_message', {
+ targetMessageID: request.targetMessageID,
+ text: request.text,
+ });
+ return {
+ newMessageInfos: response.newMessageInfos,
+ };
+ };
const saveMessagesActionType = 'SAVE_MESSAGES';
const processMessagesActionType = 'PROCESS_MESSAGES';
@@ -268,4 +283,5 @@
processMessagesActionType,
messageStorePruneActionType,
sendEditMessageActionTypes,
+ sendEditMessage,
};
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
@@ -573,6 +573,7 @@
};
export type EditMessagePayload = SendEditMessageResponse;
+export type SendEditMessageResult = SendEditMessageResponse;
// Used for the message info included in log-in type actions
export type GenericMessagesResult = {

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 24, 8:20 AM (20 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2699204
Default Alt Text
D7139.diff (1 KB)

Event Timeline