diff --git a/lib/permissions/minimally-encoded-thread-permissions-validators.js b/lib/permissions/minimally-encoded-thread-permissions-validators.js --- a/lib/permissions/minimally-encoded-thread-permissions-validators.js +++ b/lib/permissions/minimally-encoded-thread-permissions-validators.js @@ -13,7 +13,6 @@ MinimallyEncodedRoleInfo, MinimallyEncodedThreadCurrentUserInfo, RawThreadInfo, - ResolvedThreadInfo, ThreadInfo, } from '../types/minimally-encoded-thread-permissions-types.js'; import { threadTypeValidator } from '../types/thread-types-enum.js'; @@ -77,12 +76,6 @@ pinnedCount: t.maybe(t.Number), }); -const resolvedThreadInfoValidator: TInterface = - tShape({ - ...minimallyEncodedThreadInfoValidator.meta.props, - uiName: t.String, - }); - const minimallyEncodedRawThreadInfoValidator: TInterface = tShape({ ...legacyRawThreadInfoValidator.meta.props, @@ -105,6 +98,5 @@ minimallyEncodedMemberInfoValidator, minimallyEncodedRelativeMemberInfoValidator, minimallyEncodedThreadInfoValidator, - resolvedThreadInfoValidator, minimallyEncodedRawThreadInfoValidator, }; 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 @@ -1027,15 +1027,6 @@ 'Only visible to its members and admins of ancestor channels.', }; -function memberIsAdmin( - memberInfo: RelativeMemberInfo | MemberInfo, - threadInfo: RawThreadInfo | ThreadInfo, -): boolean { - return !!( - memberInfo.role && roleIsAdminRole(threadInfo.roles[memberInfo.role]) - ); -} - // Since we don't have access to all of the ancestor ThreadInfos, we approximate // "parent admin" as anybody with CHANGE_ROLE permissions. function memberHasAdminPowers( @@ -1808,7 +1799,6 @@ threadUIName, threadInfoFromRawThreadInfo, threadTypeDescriptions, - memberIsAdmin, memberHasAdminPowers, roleIsAdminRole, threadHasAdminRole, diff --git a/lib/types/minimally-encoded-thread-permissions-types.js b/lib/types/minimally-encoded-thread-permissions-types.js --- a/lib/types/minimally-encoded-thread-permissions-types.js +++ b/lib/types/minimally-encoded-thread-permissions-types.js @@ -8,7 +8,6 @@ import type { LegacyMemberInfo, LegacyRawThreadInfo, - LegacyRelativeMemberInfo, LegacyRoleInfo, ThreadCurrentUserInfo, } from './thread-types.js'; @@ -122,32 +121,6 @@ +isViewer: boolean, }>; -const minimallyEncodeRelativeMemberInfo = ( - relativeMemberInfo: LegacyRelativeMemberInfo, -): MinimallyEncodedRelativeMemberInfo => { - invariant( - !('minimallyEncoded' in relativeMemberInfo), - 'relativeMemberInfo is already minimally encoded.', - ); - return { - ...relativeMemberInfo, - minimallyEncoded: true, - permissions: permissionsToBitmaskHex(relativeMemberInfo.permissions), - }; -}; - -const decodeMinimallyEncodedRelativeMemberInfo = ( - minimallyEncodedRelativeMemberInfo: MinimallyEncodedRelativeMemberInfo, -): LegacyRelativeMemberInfo => { - const { minimallyEncoded, ...rest } = minimallyEncodedRelativeMemberInfo; - return { - ...rest, - permissions: threadPermissionsFromBitmaskHex( - minimallyEncodedRelativeMemberInfo.permissions, - ), - }; -}; - export type RawThreadInfo = $ReadOnly<{ ...LegacyRawThreadInfo, +minimallyEncoded: true, @@ -221,6 +194,4 @@ decodeMinimallyEncodedMemberInfo, minimallyEncodeRawThreadInfo, decodeMinimallyEncodedRawThreadInfo, - minimallyEncodeRelativeMemberInfo, - decodeMinimallyEncodedRelativeMemberInfo, };