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(