Page MenuHomePhabricator

D6520.id21826.diff
No OneTemporary

D6520.id21826.diff

diff --git a/lib/shared/messages/update-relationship-message-spec.js b/lib/shared/messages/update-relationship-message-spec.js
--- a/lib/shared/messages/update-relationship-message-spec.js
+++ b/lib/shared/messages/update-relationship-message-spec.js
@@ -17,6 +17,7 @@
import type { NotifTexts } from '../../types/notif-types';
import type { ThreadInfo } from '../../types/thread-types';
import type { RelativeUserInfo } from '../../types/user-types';
+import { ET, type EntityText } from '../../utils/entity-text';
import {
robotextToRawString,
robotextForMessageInfo,
@@ -29,7 +30,6 @@
type CreateMessageInfoParams,
type MessageSpec,
type MessageTitleParam,
- type RobotextParams,
} from './message-spec';
import { assertSingleMessageInfo } from './utils';
@@ -131,19 +131,17 @@
return { ...messageData, id };
},
- robotext(
- messageInfo: UpdateRelationshipMessageInfo,
- creator: string,
- params: RobotextParams,
- ): string {
- const target = params.robotextForUser(messageInfo.target);
+ robotext(messageInfo: UpdateRelationshipMessageInfo): EntityText {
+ const creator = ET.user({ userInfo: messageInfo.creator });
if (messageInfo.operation === 'request_sent') {
- return `${creator} sent ${target} a friend request`;
+ const target = ET.user({ userInfo: messageInfo.target });
+ return ET`${creator} sent ${target} a friend request`;
} else if (messageInfo.operation === 'request_accepted') {
- const targetPossessive = messageInfo.target.isViewer
- ? 'your'
- : `${target}'s`;
- return `${creator} accepted ${targetPossessive} friend request`;
+ const targetPossessive = ET.user({
+ userInfo: messageInfo.target,
+ possessive: true,
+ });
+ return ET`${creator} accepted ${targetPossessive} friend request`;
}
invariant(
false,

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 21, 11:42 AM (19 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2686539
Default Alt Text
D6520.id21826.diff (1 KB)

Event Timeline