Page MenuHomePhabricator

D5746.diff
No OneTemporary

D5746.diff

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

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)

Event Timeline