diff --git a/lib/shared/message-utils.js b/lib/shared/message-utils.js --- a/lib/shared/message-utils.js +++ b/lib/shared/message-utils.js @@ -43,13 +43,10 @@ ReactionMessageInfo, } from '../types/messages/reaction.js'; import type { - ThreadInfo, RawThreadInfo, + ThreadInfo, } from '../types/minimally-encoded-thread-permissions-types.js'; -import type { - LegacyRawThreadInfo, - LegacyThreadInfo, -} from '../types/thread-types.js'; +import type { LegacyRawThreadInfo } from '../types/thread-types.js'; import type { UserInfos } from '../types/user-types.js'; import { type EntityText, @@ -82,8 +79,8 @@ function robotextForMessageInfo( messageInfo: RobotextMessageInfo, - threadInfo: ?LegacyThreadInfo | ?ThreadInfo, - parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, + threadInfo: ?ThreadInfo, + parentThreadInfo: ?ThreadInfo, ): EntityText { const messageSpec = messageSpecs[messageInfo.type]; invariant( @@ -97,7 +94,7 @@ rawMessageInfo: RawMessageInfo, viewerID: ?string, userInfos: UserInfos, - threadInfos: { +[id: string]: LegacyThreadInfo | ThreadInfo }, + threadInfos: { +[id: string]: ThreadInfo }, ): ?MessageInfo { const creatorInfo = userInfos[rawMessageInfo.creatorID]; const creator = { @@ -418,8 +415,8 @@ | RobotextMessageInfo | ReactionMessageInfo | EditMessageInfo, - threadInfo: LegacyThreadInfo | ThreadInfo, - parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, + threadInfo: ThreadInfo, + parentThreadInfo: ?ThreadInfo, markdownRules: ParserRules, ): EntityText { const { messageTitle } = messageSpecs[messageInfo.type]; @@ -505,7 +502,7 @@ }; function useMessagePreview( originalMessageInfo: ?MessageInfo, - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, markdownRules: ParserRules, ): ?MessagePreviewResult { let messageInfo; @@ -687,11 +684,7 @@ function isInvalidPinSourceForThread( messageInfo: RawMessageInfo | MessageInfo, - threadInfo: - | LegacyRawThreadInfo - | RawThreadInfo - | LegacyThreadInfo - | ThreadInfo, + threadInfo: LegacyRawThreadInfo | RawThreadInfo | ThreadInfo, ): boolean { const isValidPinSource = !isInvalidPinSource(messageInfo); const isFirstMessageInSidebar = threadInfo.sourceMessageID === messageInfo.id; diff --git a/lib/shared/messages/add-members-message-spec.js b/lib/shared/messages/add-members-message-spec.js --- a/lib/shared/messages/add-members-message-spec.js +++ b/lib/shared/messages/add-members-message-spec.js @@ -21,7 +21,6 @@ } from '../../types/messages/add-members.js'; import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; -import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; import { type EntityText, @@ -125,7 +124,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, params: NotificationTextsParams, ): Promise { const addedMembersObject: { [string]: RelativeUserInfo } = {}; diff --git a/lib/shared/messages/change-role-message-spec.js b/lib/shared/messages/change-role-message-spec.js --- a/lib/shared/messages/change-role-message-spec.js +++ b/lib/shared/messages/change-role-message-spec.js @@ -25,7 +25,6 @@ import type { RawUnsupportedMessageInfo } from '../../types/messages/unsupported'; import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; -import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; import { type EntityText, @@ -159,7 +158,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, params: NotificationTextsParams, ): Promise { const membersObject: { [string]: RelativeUserInfo } = {}; diff --git a/lib/shared/messages/change-settings-message-spec.js b/lib/shared/messages/change-settings-message-spec.js --- a/lib/shared/messages/change-settings-message-spec.js +++ b/lib/shared/messages/change-settings-message-spec.js @@ -23,7 +23,6 @@ import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; import { assertThreadType } from '../../types/thread-types-enum.js'; -import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; import { type EntityText, ET } from '../../utils/entity-text.js'; import { validHexColorRegex } from '../account-utils.js'; @@ -159,7 +158,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, params: NotificationTextsParams, ): Promise { const mostRecentMessageInfo = messageInfos[0]; diff --git a/lib/shared/messages/create-entry-message-spec.js b/lib/shared/messages/create-entry-message-spec.js --- a/lib/shared/messages/create-entry-message-spec.js +++ b/lib/shared/messages/create-entry-message-spec.js @@ -17,7 +17,6 @@ } from '../../types/messages/create-entry.js'; import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; -import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; import { prettyDate } from '../../utils/date-utils.js'; import { type EntityText, ET } from '../../utils/entity-text.js'; @@ -120,7 +119,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, ): Promise { return notifTextsForEntryCreationOrEdit(messageInfos, threadInfo); }, diff --git a/lib/shared/messages/create-sidebar-message-spec.js b/lib/shared/messages/create-sidebar-message-spec.js --- a/lib/shared/messages/create-sidebar-message-spec.js +++ b/lib/shared/messages/create-sidebar-message-spec.js @@ -23,7 +23,6 @@ } from '../../types/messages/create-sidebar.js'; import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; -import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; import { type EntityText, @@ -174,7 +173,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, params: NotificationTextsParams, ): Promise { const createSidebarMessageInfo = messageInfos[0]; diff --git a/lib/shared/messages/create-sub-thread-message-spec.js b/lib/shared/messages/create-sub-thread-message-spec.js --- a/lib/shared/messages/create-sub-thread-message-spec.js +++ b/lib/shared/messages/create-sub-thread-message-spec.js @@ -25,7 +25,6 @@ import type { NotifTexts } from '../../types/notif-types.js'; import { threadPermissions } from '../../types/thread-permission-types.js'; import { threadTypes } from '../../types/thread-types-enum.js'; -import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; import { type EntityText, ET } from '../../utils/entity-text.js'; import { notifTextsForSubthreadCreation } from '../notif-utils.js'; @@ -141,7 +140,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, ): Promise { const messageInfo = assertSingleMessageInfo(messageInfos); invariant( diff --git a/lib/shared/messages/create-thread-message-spec.js b/lib/shared/messages/create-thread-message-spec.js --- a/lib/shared/messages/create-thread-message-spec.js +++ b/lib/shared/messages/create-thread-message-spec.js @@ -22,7 +22,6 @@ } from '../../types/messages/create-thread.js'; import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; -import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; import { type EntityText, @@ -158,7 +157,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, ): Promise { const messageInfo = assertSingleMessageInfo(messageInfos); invariant( diff --git a/lib/shared/messages/delete-entry-message-spec.js b/lib/shared/messages/delete-entry-message-spec.js --- a/lib/shared/messages/delete-entry-message-spec.js +++ b/lib/shared/messages/delete-entry-message-spec.js @@ -17,7 +17,6 @@ } from '../../types/messages/delete-entry.js'; import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; -import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; import { prettyDate } from '../../utils/date-utils.js'; import { type EntityText, ET } from '../../utils/entity-text.js'; @@ -119,7 +118,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, ): Promise { const messageInfo = assertSingleMessageInfo(messageInfos); invariant( diff --git a/lib/shared/messages/edit-entry-message-spec.js b/lib/shared/messages/edit-entry-message-spec.js --- a/lib/shared/messages/edit-entry-message-spec.js +++ b/lib/shared/messages/edit-entry-message-spec.js @@ -17,7 +17,6 @@ } from '../../types/messages/edit-entry.js'; import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; -import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; import { prettyDate } from '../../utils/date-utils.js'; import { type EntityText, ET } from '../../utils/entity-text.js'; @@ -120,7 +119,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, ): Promise { return notifTextsForEntryCreationOrEdit(messageInfos, threadInfo); }, 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 @@ -17,7 +17,6 @@ } from '../../types/messages/join-thread.js'; import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; -import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; import { type EntityText, @@ -90,7 +89,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, ): Promise { const joinerArray: { [string]: RelativeUserInfo } = {}; for (const messageInfo of messageInfos) { 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 @@ -17,7 +17,6 @@ } from '../../types/messages/leave-thread.js'; import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; -import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; import { type EntityText, @@ -90,7 +89,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, ): Promise { const leaverBeavers: { [string]: RelativeUserInfo } = {}; for (const messageInfo of messageInfos) { diff --git a/lib/shared/messages/message-spec.js b/lib/shared/messages/message-spec.js --- a/lib/shared/messages/message-spec.js +++ b/lib/shared/messages/message-spec.js @@ -14,14 +14,13 @@ import type { RawUnsupportedMessageInfo } from '../../types/messages/unsupported.js'; import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; -import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo, UserInfo } from '../../types/user-types.js'; import type { EntityText } from '../../utils/entity-text.js'; import { type ParserRules } from '../markdown.js'; export type MessageTitleParam = { +messageInfo: Info, - +threadInfo: LegacyThreadInfo | ThreadInfo, + +threadInfo: ThreadInfo, +markdownRules: ParserRules, }; @@ -36,7 +35,7 @@ export type CreateMessageInfoParams = { +threadInfos: { - +[id: string]: LegacyThreadInfo | ThreadInfo, + +[id: string]: ThreadInfo, }, +createMessageInfoFromRaw: (rawInfo: RawMessageInfo) => ?MessageInfo, +createRelativeUserInfos: ( @@ -45,13 +44,13 @@ }; export type RobotextParams = { - +threadInfo: ?LegacyThreadInfo | ?ThreadInfo, - +parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, + +threadInfo: ?ThreadInfo, + +parentThreadInfo: ?ThreadInfo, }; export type NotificationTextsParams = { +notifTargetUserInfo: UserInfo, - +parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, + +parentThreadInfo: ?ThreadInfo, }; export type GeneratesNotifsParams = { @@ -68,8 +67,8 @@ export type CreationSideEffectsFunc = ( messageInfo: RawInfo, - threadInfo: LegacyThreadInfo | ThreadInfo, - parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, + threadInfo: ThreadInfo, + parentThreadInfo: ?ThreadInfo, ) => Promise; export type MessageSpec = { @@ -100,7 +99,7 @@ ) => ?RawMessageInfo, +notificationTexts?: ( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, params: NotificationTextsParams, ) => Promise, +notificationCollapseKey?: ( diff --git a/lib/shared/messages/multimedia-message-spec.js b/lib/shared/messages/multimedia-message-spec.js --- a/lib/shared/messages/multimedia-message-spec.js +++ b/lib/shared/messages/multimedia-message-spec.js @@ -43,7 +43,6 @@ import type { RawUnsupportedMessageInfo } from '../../types/messages/unsupported.js'; import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; -import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; import { ET } from '../../utils/entity-text.js'; import { @@ -312,7 +311,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, ): Promise { const media = []; for (const messageInfo of messageInfos) { diff --git a/lib/shared/messages/reaction-message-spec.js b/lib/shared/messages/reaction-message-spec.js --- a/lib/shared/messages/reaction-message-spec.js +++ b/lib/shared/messages/reaction-message-spec.js @@ -27,7 +27,6 @@ import type { RawUnsupportedMessageInfo } from '../../types/messages/unsupported.js'; import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; -import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; import { ET } from '../../utils/entity-text.js'; import { threadIsGroupChat } from '../thread-utils.js'; @@ -164,7 +163,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, ): Promise { const messageInfo = assertSingleMessageInfo(messageInfos); invariant( diff --git a/lib/shared/messages/remove-members-message-spec.js b/lib/shared/messages/remove-members-message-spec.js --- a/lib/shared/messages/remove-members-message-spec.js +++ b/lib/shared/messages/remove-members-message-spec.js @@ -21,7 +21,6 @@ } from '../../types/messages/remove-members.js'; import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; -import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; import { type EntityText, @@ -126,7 +125,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, params: NotificationTextsParams, ): Promise { const removedMembersObject: { [string]: RelativeUserInfo } = {}; diff --git a/lib/shared/messages/restore-entry-message-spec.js b/lib/shared/messages/restore-entry-message-spec.js --- a/lib/shared/messages/restore-entry-message-spec.js +++ b/lib/shared/messages/restore-entry-message-spec.js @@ -17,7 +17,6 @@ } from '../../types/messages/restore-entry.js'; import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; -import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; import { prettyDate } from '../../utils/date-utils.js'; import { type EntityText, ET } from '../../utils/entity-text.js'; @@ -119,7 +118,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, ): Promise { const messageInfo = assertSingleMessageInfo(messageInfos); invariant( diff --git a/lib/shared/messages/text-message-spec.js b/lib/shared/messages/text-message-spec.js --- a/lib/shared/messages/text-message-spec.js +++ b/lib/shared/messages/text-message-spec.js @@ -28,7 +28,6 @@ import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; import { threadTypes } from '../../types/thread-types-enum.js'; -import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; import { ET } from '../../utils/entity-text.js'; import { useDispatchActionPromise } from '../../utils/redux-promise-utils.js'; @@ -199,7 +198,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, params: NotificationTextsParams, ): Promise { // We special-case sidebarCreations. Usually we don't send any notifs in @@ -295,8 +294,8 @@ const callChangeThreadSettings = useChangeThreadSettings(); return async ( messageInfo: RawTextMessageInfo, - threadInfo: LegacyThreadInfo | ThreadInfo, - parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, + threadInfo: ThreadInfo, + parentThreadInfo: ?ThreadInfo, ) => { if (threadInfo.type !== threadTypes.SIDEBAR) { return; 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 @@ -21,7 +21,6 @@ } from '../../types/messages/update-relationship.js'; import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; -import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; import { type EntityText, ET } from '../../utils/entity-text.js'; @@ -149,7 +148,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, ): Promise { const messageInfo = assertSingleMessageInfo(messageInfos); const creator = ET.user({ userInfo: messageInfo.creator }); diff --git a/lib/shared/notif-utils.js b/lib/shared/notif-utils.js --- a/lib/shared/notif-utils.js +++ b/lib/shared/notif-utils.js @@ -20,7 +20,6 @@ import type { ThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts, ResolvedNotifTexts } from '../types/notif-types.js'; import { type ThreadType, threadTypes } from '../types/thread-types-enum.js'; -import type { LegacyThreadInfo } from '../types/thread-types.js'; import type { RelativeUserInfo, UserInfo } from '../types/user-types.js'; import { prettyDate } from '../utils/date-utils.js'; import type { GetENSNames } from '../utils/ens-helpers.js'; @@ -35,8 +34,8 @@ async function notifTextsForMessageInfo( messageInfos: MessageInfo[], - threadInfo: LegacyThreadInfo | ThreadInfo, - parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, + threadInfo: ThreadInfo, + parentThreadInfo: ?ThreadInfo, notifTargetUserInfo: UserInfo, getENSNames: ?GetENSNames, ): Promise { @@ -62,7 +61,7 @@ function notifTextsForEntryCreationOrEdit( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, ): NotifTexts { const hasCreateEntry = messageInfos.some( messageInfo => messageInfo.type === messageTypes.CREATE_ENTRY, @@ -109,7 +108,7 @@ type NotifTextsForSubthreadCreationInput = { +creator: RelativeUserInfo, +threadType: ThreadType, - +parentThreadInfo: LegacyThreadInfo | ThreadInfo, + +parentThreadInfo: ThreadInfo, +childThreadName: ?string, +childThreadUIName: string | ThreadEntity, }; @@ -151,7 +150,7 @@ +createSidebarMessageInfo: CreateSidebarMessageInfo, +sidebarSourceMessageInfo?: ?SidebarSourceMessageInfo, +firstSidebarMessageInfo?: ?TextMessageInfo, - +threadInfo: LegacyThreadInfo | ThreadInfo, + +threadInfo: ThreadInfo, +params: NotificationTextsParams, }; function notifTextsForSidebarCreation( @@ -215,8 +214,8 @@ async function fullNotifTextsForMessageInfo( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | ThreadInfo, - parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, + threadInfo: ThreadInfo, + parentThreadInfo: ?ThreadInfo, notifTargetUserInfo: UserInfo, getENSNames: ?GetENSNames, ): Promise { @@ -266,8 +265,8 @@ function notifRobotextForMessageInfo( messageInfo: RobotextMessageInfo, - threadInfo: LegacyThreadInfo | ThreadInfo, - parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, + threadInfo: ThreadInfo, + parentThreadInfo: ?ThreadInfo, ): EntityText { const robotext = robotextForMessageInfo( messageInfo, diff --git a/lib/shared/thread-utils.js b/lib/shared/thread-utils.js --- a/lib/shared/thread-utils.js +++ b/lib/shared/thread-utils.js @@ -244,7 +244,7 @@ ); } -function threadIsGroupChat(threadInfo: LegacyThreadInfo | ThreadInfo): boolean { +function threadIsGroupChat(threadInfo: ThreadInfo): boolean { return threadInfo.members.length > 2; } @@ -325,7 +325,7 @@ +viewerID: string, +threadType: ThreadType, +members: $ReadOnlyArray, - +parentThreadInfo?: ?(LegacyThreadInfo | ThreadInfo), + +parentThreadInfo?: ?ThreadInfo, +threadColor?: ?string, +name?: ?string, +sourceMessageID?: string, @@ -470,7 +470,7 @@ // Returns map from user ID to AccountUserInfo function extractMentionedMembers( text: string, - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, ): Map { const memberMap = memberLowercaseUsernameMap(threadInfo.members); const mentions = extractUserMentionsFromText(text); @@ -489,8 +489,8 @@ // they will be automatically added to that sidebar function extractNewMentionedParentMembers( messageText: string, - threadInfo: LegacyThreadInfo | ThreadInfo, - parentThreadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, + parentThreadInfo: ThreadInfo, ): AccountUserInfo[] { const mentionedMembersOfParent = extractMentionedMembers( messageText, @@ -678,7 +678,7 @@ } type CreateRealThreadParameters = { - +threadInfo: LegacyThreadInfo | ThreadInfo, + +threadInfo: ThreadInfo, +dispatchActionPromise: DispatchActionPromise, +createNewThread: ClientNewThreadRequest => Promise, +sourceMessageID: ?string, @@ -1427,7 +1427,6 @@ | ?ServerThreadInfo | LegacyRawThreadInfo | RawThreadInfo - | LegacyThreadInfo | ThreadInfo, threadType: ThreadType, ): ?string { @@ -1448,7 +1447,6 @@ | ?ServerThreadInfo | LegacyRawThreadInfo | RawThreadInfo - | LegacyThreadInfo | ThreadInfo, ): ?string { if (!parentThreadInfo) { @@ -1689,7 +1687,7 @@ // the set of permission literals for each role to user-facing permission enums // to help pre-populate the permission checkboxes when editing roles. function useRoleUserSurfacedPermissions( - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, ): RoleUserSurfacedPermissions { return React.useMemo(() => { const roleNamesToPermissions: { [string]: Set } = diff --git a/lib/types/messages/create-sidebar.js b/lib/types/messages/create-sidebar.js --- a/lib/types/messages/create-sidebar.js +++ b/lib/types/messages/create-sidebar.js @@ -5,7 +5,6 @@ import { tID, tNumber, tShape } from '../../utils/validation-utils.js'; import { messageTypes } from '../message-types-enum.js'; import type { ThreadInfo } from '../minimally-encoded-thread-permissions-types.js'; -import type { LegacyThreadInfo } from '../thread-types.js'; import type { RelativeUserInfo } from '../user-types.js'; export type CreateSidebarMessageData = { @@ -52,7 +51,7 @@ +sourceMessageAuthor: RelativeUserInfo, +initialThreadState: { +name: ?string, - +parentThreadInfo: LegacyThreadInfo | ThreadInfo, + +parentThreadInfo: ThreadInfo, +color: string, +otherMembers: RelativeUserInfo[], }, diff --git a/lib/types/messages/create-subthread.js b/lib/types/messages/create-subthread.js --- a/lib/types/messages/create-subthread.js +++ b/lib/types/messages/create-subthread.js @@ -5,7 +5,6 @@ import { tID, tNumber, tShape } from '../../utils/validation-utils.js'; import { messageTypes } from '../message-types-enum.js'; import type { ThreadInfo } from '../minimally-encoded-thread-permissions-types.js'; -import type { LegacyThreadInfo } from '../thread-types.js'; import type { RelativeUserInfo } from '../user-types.js'; export type CreateSubthreadMessageData = { @@ -37,5 +36,5 @@ threadID: string, creator: RelativeUserInfo, time: number, - childThreadInfo: LegacyThreadInfo | ThreadInfo, + childThreadInfo: ThreadInfo, }; diff --git a/lib/types/messages/create-thread.js b/lib/types/messages/create-thread.js --- a/lib/types/messages/create-thread.js +++ b/lib/types/messages/create-thread.js @@ -12,7 +12,6 @@ import { messageTypes } from '../message-types-enum.js'; import type { ThreadInfo } from '../minimally-encoded-thread-permissions-types.js'; import { type ThreadType, threadTypes } from '../thread-types-enum.js'; -import type { LegacyThreadInfo } from '../thread-types.js'; import type { RelativeUserInfo } from '../user-types.js'; export type CreateThreadMessageData = { @@ -59,7 +58,7 @@ initialThreadState: { type: ThreadType, name: ?string, - parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, + parentThreadInfo: ?ThreadInfo, color: string, otherMembers: RelativeUserInfo[], }, diff --git a/lib/utils/entity-text.js b/lib/utils/entity-text.js --- a/lib/utils/entity-text.js +++ b/lib/utils/entity-text.js @@ -10,18 +10,15 @@ import { threadNoun } from '../shared/thread-utils.js'; import { stringForUser } from '../shared/user-utils.js'; import type { - ThreadInfo, RawThreadInfo, + ThreadInfo, } from '../types/minimally-encoded-thread-permissions-types.js'; import { type ThreadType, threadTypes, threadTypeValidator, } from '../types/thread-types-enum.js'; -import type { - LegacyRawThreadInfo, - LegacyThreadInfo, -} from '../types/thread-types.js'; +import type { LegacyRawThreadInfo } from '../types/thread-types.js'; import { basePluralize } from '../utils/text-utils.js'; export type UserEntity = { @@ -141,25 +138,17 @@ type EntityTextThreadInput = | { +display: 'uiName', - +threadInfo: LegacyThreadInfo | ThreadInfo, + +threadInfo: ThreadInfo, } | { +display?: 'shortName', - +threadInfo: - | LegacyRawThreadInfo - | RawThreadInfo - | LegacyThreadInfo - | ThreadInfo, + +threadInfo: LegacyRawThreadInfo | RawThreadInfo | ThreadInfo, +subchannel?: ?boolean, +possessive?: ?boolean, } | { +display: 'alwaysDisplayShortName', - +threadInfo: - | LegacyRawThreadInfo - | RawThreadInfo - | LegacyThreadInfo - | ThreadInfo, + +threadInfo: LegacyRawThreadInfo | RawThreadInfo | ThreadInfo, +possessive?: ?boolean, } | {