Page MenuHomePhabricator

D5746.id18900.diff
No OneTemporary

D5746.id18900.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 } 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

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)

Event Timeline