diff --git a/lib/shared/avatar-utils.js b/lib/shared/avatar-utils.js --- a/lib/shared/avatar-utils.js +++ b/lib/shared/avatar-utils.js @@ -21,7 +21,6 @@ RawThreadInfo, } from '../types/minimally-encoded-thread-permissions-types.js'; import { threadTypes } from '../types/thread-types-enum.js'; -import type { LegacyRawThreadInfo } from '../types/thread-types.js'; import type { UserInfos } from '../types/user-types.js'; import { useSelector } from '../utils/redux-utils.js'; import { ashoatKeyserverID } from '../utils/validation-utils.js'; @@ -274,7 +273,7 @@ } function getUserAvatarForThread( - threadInfo: LegacyRawThreadInfo | RawThreadInfo | ThreadInfo, + threadInfo: RawThreadInfo | ThreadInfo, viewerID: ?string, userInfos: UserInfos, ): ClientAvatar { 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 @@ -91,7 +91,6 @@ LegacyRawThreadInfo, MemberInfo, ServerThreadInfo, - ThreadCurrentUserInfo, RoleInfo, ServerMemberInfo, ClientNewThreadRequest, @@ -207,7 +206,7 @@ } function userIsMember( - threadInfo: ?(LegacyRawThreadInfo | RawThreadInfo | ThreadInfo), + threadInfo: ?(RawThreadInfo | ThreadInfo), userID: string, ): boolean { if (!threadInfo) { @@ -951,24 +950,6 @@ return threadInfo; } -function getCurrentUser( - threadInfo: LegacyRawThreadInfo, - viewerID: ?string, - userInfos: UserInfos, -): ThreadCurrentUserInfo { - if (!threadFrozenDueToBlock(threadInfo, viewerID, userInfos)) { - return threadInfo.currentUser; - } - - return { - ...threadInfo.currentUser, - permissions: { - ...threadInfo.currentUser.permissions, - ...disabledPermissions, - }, - }; -} - function getMinimallyEncodedCurrentUser( threadInfo: RawThreadInfo | ThreadInfo, viewerID: ?string, @@ -1820,7 +1801,6 @@ createPendingSidebar, pendingThreadType, createRealThreadFromPendingThread, - getCurrentUser, getMinimallyEncodedCurrentUser, threadFrozenDueToBlock, threadFrozenDueToViewerBlock, 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 @@ -18,7 +18,6 @@ threadTypes, threadTypeValidator, } from '../types/thread-types-enum.js'; -import type { LegacyRawThreadInfo } from '../types/thread-types.js'; import { basePluralize } from '../utils/text-utils.js'; export type UserEntity = { @@ -142,13 +141,13 @@ } | { +display?: 'shortName', - +threadInfo: LegacyRawThreadInfo | RawThreadInfo | ThreadInfo, + +threadInfo: RawThreadInfo | ThreadInfo, +subchannel?: ?boolean, +possessive?: ?boolean, } | { +display: 'alwaysDisplayShortName', - +threadInfo: LegacyRawThreadInfo | RawThreadInfo | ThreadInfo, + +threadInfo: RawThreadInfo | ThreadInfo, +possessive?: ?boolean, } | {