Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3504974
D6520.id21826.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
D6520.id21826.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D6520: [lib] Convert UpdateRelationship robotext to use EntityText
Attached
Detach File
Event Timeline
Log In to Comment