Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33292694
D6117.1768738768.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D6117.1768738768.diff
View Options
diff --git a/lib/shared/message-utils.js b/lib/shared/message-utils.js
--- a/lib/shared/message-utils.js
+++ b/lib/shared/message-utils.js
@@ -25,7 +25,10 @@
} from '../types/message-types';
import type { ImagesMessageData } from '../types/messages/images';
import type { MediaMessageData } from '../types/messages/media';
-import type { ReactionMessageInfo } from '../types/messages/reaction';
+import type {
+ RawReactionMessageInfo,
+ ReactionMessageInfo,
+} from '../types/messages/reaction';
import { type ThreadInfo } from '../types/thread-types';
import type { RelativeUserInfo, UserInfos } from '../types/user-types';
import { codeBlockRegex, type ParserRules } from './markdown';
@@ -359,7 +362,9 @@
return result;
}
-function stripLocalID(rawMessageInfo: RawComposableMessageInfo) {
+function stripLocalID(
+ rawMessageInfo: RawComposableMessageInfo | RawReactionMessageInfo,
+) {
const { localID, ...rest } = rawMessageInfo;
return rest;
}
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
@@ -192,7 +192,8 @@
if (
messageData.type !== messageTypes.TEXT &&
messageData.type !== messageTypes.IMAGES &&
- messageData.type !== messageTypes.MULTIMEDIA
+ messageData.type !== messageTypes.MULTIMEDIA &&
+ messageData.type !== messageTypes.REACTION
) {
return null;
}
@@ -551,6 +552,7 @@
export type SendReactionMessageRequest = {
+threadID: string,
+ +localID?: string,
+targetMessageID: string,
+reaction: string,
+action: 'add_reaction' | 'remove_reaction',
diff --git a/lib/types/messages/reaction.js b/lib/types/messages/reaction.js
--- a/lib/types/messages/reaction.js
+++ b/lib/types/messages/reaction.js
@@ -4,6 +4,7 @@
export type ReactionMessageData = {
+type: 19,
+ +localID?: string, // for optimistic creations. included by new clients
+threadID: string,
+creatorID: string,
+time: number,
@@ -14,12 +15,13 @@
export type RawReactionMessageInfo = {
...ReactionMessageData,
- id: string,
+ id?: string, // null if local copy without ID yet
};
export type ReactionMessageInfo = {
+type: 19,
- +id: string,
+ +id?: string, // null if local copy without ID yet
+ +localID?: string, // for optimistic creations
+threadID: string,
+creator: RelativeUserInfo,
+time: number,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 18, 12:19 PM (6 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5951673
Default Alt Text
D6117.1768738768.diff (2 KB)
Attached To
Mode
D6117: [lib] add localID field to reaction message type
Attached
Detach File
Event Timeline
Log In to Comment