Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3242478
D5746.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.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,
@@ -10,8 +11,10 @@
type RawReactionMessageInfo,
type ReactionMessageInfo,
} from '../../types/message-types';
+import type { RawUnsupportedMessageInfo } from '../../types/messages/unsupported';
import type { RelativeUserInfo } from '../../types/user-types';
import { messagePreviewText, removeCreatorAsViewer } from '../message-utils';
+import { hasMinCodeVersion } from '../version-utils';
import type { MessageSpec, MessageTitleParam } from './message-spec';
export const reactionMessageSpec: MessageSpec<
@@ -93,5 +96,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: 'liked a message',
+ unsupportedMessageInfo: rawMessageInfo,
+ };
+ },
+
generatesNotifs: false,
});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 14, 10:29 PM (12 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2492923
Default Alt Text
D5746.diff (1 KB)
Attached To
Mode
D5746: [lib] introduced shimUnsupportedMessageInfo function to reaction message spec
Attached
Detach File
Event Timeline
Log In to Comment