Page MenuHomePhabricator

D8628.id29346.diff
No OneTemporary

D8628.id29346.diff

diff --git a/lib/shared/inline-engagement-utils.js b/lib/shared/inline-engagement-utils.js
--- a/lib/shared/inline-engagement-utils.js
+++ b/lib/shared/inline-engagement-utils.js
@@ -1,5 +1,6 @@
// @flow
+import type { ReactionInfo } from '../selectors/chat-selectors.js';
import type { ThreadInfo } from '../types/thread-types.js';
function getInlineEngagementSidebarText(threadInfo: ?ThreadInfo): string {
@@ -10,4 +11,15 @@
return `${repliesCount} ${repliesCount > 1 ? 'replies' : 'reply'}`;
}
-export { getInlineEngagementSidebarText };
+function reactionsToRawString(reactions: ReactionInfo): string {
+ const reactionStringParts = [];
+
+ for (const reaction in reactions) {
+ const reactionInfo = reactions[reaction];
+ reactionStringParts.push(`${reaction}${reactionInfo.users.length}`);
+ }
+
+ return reactionStringParts.join('');
+}
+
+export { getInlineEngagementSidebarText, reactionsToRawString };
diff --git a/native/chat/chat-item-height-measurer.react.js b/native/chat/chat-item-height-measurer.react.js
--- a/native/chat/chat-item-height-measurer.react.js
+++ b/native/chat/chat-item-height-measurer.react.js
@@ -3,6 +3,10 @@
import invariant from 'invariant';
import * as React from 'react';
+import {
+ getInlineEngagementSidebarText,
+ reactionsToRawString,
+} from 'lib/shared/inline-engagement-utils.js';
import { messageID } from 'lib/shared/message-utils.js';
import {
messageTypes,
@@ -29,13 +33,16 @@
if (item.itemType !== 'message') {
return null;
}
- const { messageInfo } = item;
+ const { messageInfo, threadCreatedFromMessage, reactions } = item;
+
if (messageInfo.type === messageTypes.TEXT) {
return JSON.stringify({ text: messageInfo.text });
} else if (item.robotext) {
const { threadID } = item.messageInfo;
return JSON.stringify({
robotext: entityTextToRawString(item.robotext, { threadID }),
+ sidebar: getInlineEngagementSidebarText(threadCreatedFromMessage),
+ reactions: reactionsToRawString(reactions),
});
}
return null;

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 2, 5:18 PM (20 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2608331
Default Alt Text
D8628.id29346.diff (2 KB)

Event Timeline