Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3293945
D6515.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D6515.diff
View Options
diff --git a/lib/shared/messages/join-thread-message-spec.js b/lib/shared/messages/join-thread-message-spec.js
--- a/lib/shared/messages/join-thread-message-spec.js
+++ b/lib/shared/messages/join-thread-message-spec.js
@@ -15,6 +15,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 { values } from '../../utils/objects';
import { pluralize } from '../../utils/text-utils';
import {
@@ -27,7 +28,6 @@
MessageSpec,
MessageTitleParam,
NotificationTextsParams,
- RobotextParams,
} from './message-spec';
import { joinResult } from './utils';
@@ -94,15 +94,12 @@
return { ...messageData, id };
},
- robotext(
- messageInfo: JoinThreadMessageInfo,
- creator: string,
- params: RobotextParams,
- ): string {
- return (
- `${creator} joined ` +
- params.encodedThreadEntity(messageInfo.threadID, 'this chat')
- );
+ robotext(messageInfo: JoinThreadMessageInfo): EntityText {
+ const creator = ET.user({ userInfo: messageInfo.creator });
+ return ET`${creator} joined ${ET.thread({
+ display: 'alwaysDisplayShortName',
+ threadID: messageInfo.threadID,
+ })}`;
},
notificationTexts(
diff --git a/lib/shared/messages/leave-thread-message-spec.js b/lib/shared/messages/leave-thread-message-spec.js
--- a/lib/shared/messages/leave-thread-message-spec.js
+++ b/lib/shared/messages/leave-thread-message-spec.js
@@ -15,6 +15,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 { values } from '../../utils/objects';
import { pluralize } from '../../utils/text-utils';
import {
@@ -27,7 +28,6 @@
MessageSpec,
MessageTitleParam,
NotificationTextsParams,
- RobotextParams,
} from './message-spec';
import { joinResult } from './utils';
@@ -94,15 +94,12 @@
return { ...messageData, id };
},
- robotext(
- messageInfo: LeaveThreadMessageInfo,
- creator: string,
- params: RobotextParams,
- ): string {
- return (
- `${creator} left ` +
- params.encodedThreadEntity(messageInfo.threadID, 'this chat')
- );
+ robotext(messageInfo: LeaveThreadMessageInfo): EntityText {
+ const creator = ET.user({ userInfo: messageInfo.creator });
+ return ET`${creator} left ${ET.thread({
+ display: 'alwaysDisplayShortName',
+ threadID: messageInfo.threadID,
+ })}`;
},
notificationTexts(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 6:25 PM (21 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2531014
Default Alt Text
D6515.diff (2 KB)
Attached To
Mode
D6515: [lib] Convert JoinThread/LeaveThread robotext to use EntityText
Attached
Detach File
Event Timeline
Log In to Comment