Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3523080
D7139.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D7139.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D7139: [lib] Added method to call edit_message endpoint
Attached
Detach File
Event Timeline
Log In to Comment