Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3380508
D5746.id18900.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
D5746.id18900.diff
View Options
diff --git a/lib/shared/messages/reaction-message-spec.js b/lib/shared/messages/reaction-message-spec.js
--- a/lib/shared/messages/reaction-message-spec.js
+++ b/lib/shared/messages/reaction-message-spec.js
@@ -2,6 +2,7 @@
import invariant from 'invariant';
+import type { PlatformDetails } from '../../types/device-types';
import { assertMessageType, messageTypes } from '../../types/message-types';
import type {
ClientDBMessageInfo,
@@ -9,8 +10,10 @@
RawReactionMessageInfo,
ReactionMessageInfo,
} from '../../types/message-types';
+import type { RawUnsupportedMessageInfo } from '../../types/messages/unsupported';
import type { RelativeUserInfo } from '../../types/user-types';
import { messagePreviewText } from '../message-utils';
+import { hasMinCodeVersion } from '../version-utils';
import type { MessageSpec, MessageTitleParam } from './message-spec';
export const reactionMessageSpec: MessageSpec<
@@ -89,5 +92,27 @@
};
},
+ shimUnsupportedMessageInfo(
+ rawMessageInfo: RawReactionMessageInfo,
+ platformDetails: ?PlatformDetails,
+ ): RawReactionMessageInfo | RawUnsupportedMessageInfo {
+ // TODO: change minCodeVersion to correct number when ready
+ if (hasMinCodeVersion(platformDetails, 999)) {
+ return rawMessageInfo;
+ }
+ const { id } = rawMessageInfo;
+ invariant(id !== null && id !== undefined, 'id should be set on server');
+
+ return {
+ type: messageTypes.UNSUPPORTED,
+ id,
+ threadID: rawMessageInfo.threadID,
+ creatorID: rawMessageInfo.creatorID,
+ time: rawMessageInfo.time,
+ robotext: 'sent a reaction',
+ unsupportedMessageInfo: rawMessageInfo,
+ };
+ },
+
generatesNotifs: true,
});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 29, 12:13 AM (21 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2595241
Default Alt Text
D5746.id18900.diff (1 KB)
Attached To
Mode
D5746: [lib] introduced shimUnsupportedMessageInfo function to reaction message spec
Attached
Detach File
Event Timeline
Log In to Comment