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 @@ -992,26 +992,6 @@ ); } -function threadIsWithBlockedUserOnly( - threadInfo: LegacyRawThreadInfo | RawThreadInfo, - viewerID: ?string, - userInfos: UserInfos, - checkOnlyViewerBlock: boolean, -): boolean { - if ( - threadOrParentThreadIsGroupChat(threadInfo) || - threadOrParentThreadHasAdminRole(threadInfo) - ) { - return false; - } - return baseThreadIsWithBlockedUserOnly( - threadInfo, - viewerID, - userInfos, - checkOnlyViewerBlock, - ); -} - function threadIsWithBlockedUserOnlyWithoutAdminRoleCheck( threadInfo: ThreadInfo | RawThreadInfo | LegacyRawThreadInfo, viewerID: ?string, @@ -1029,14 +1009,6 @@ ); } -function threadFrozenDueToBlock( - threadInfo: LegacyRawThreadInfo | RawThreadInfo, - viewerID: ?string, - userInfos: UserInfos, -): boolean { - return threadIsWithBlockedUserOnly(threadInfo, viewerID, userInfos, false); -} - function useThreadFrozenDueToViewerBlock( threadInfo: ThreadInfo, communityThreadInfo: ?ThreadInfo, @@ -1077,19 +1049,6 @@ 'Only visible to its members and admins of ancestor channels.', }; -// Since we don't have access to all of the ancestor ThreadInfos, we approximate -// "parent admin" as anybody with CHANGE_ROLE permissions. -function memberHasAdminPowers( - memberInfo: - | { +minimallyEncoded: true, +permissions: string, ... } - | { +minimallyEncoded?: void, +permissions: ThreadPermissionsInfo, ... }, -): boolean { - if (memberInfo.minimallyEncoded) { - return hasPermission(memberInfo.permissions, threadPermissions.CHANGE_ROLE); - } - return !!memberInfo.permissions[threadPermissions.CHANGE_ROLE]?.value; -} - function roleIsDefaultRole( roleInfo: ?ClientLegacyRoleInfo | ?RoleInfo, ): boolean { @@ -1132,16 +1091,6 @@ return !!_find({ name: 'Admins' })(threadInfo.roles); } -function threadOrParentThreadHasAdminRole( - threadInfo: LegacyRawThreadInfo | RawThreadInfo, -) { - return ( - threadMembersWithoutAddedAdmin(threadInfo).filter(member => - memberHasAdminPowers(member), - ).length > 0 - ); -} - function identifyInvalidatedThreads( updateInfos: $ReadOnlyArray, ): Set { @@ -1754,14 +1703,12 @@ extractNewMentionedParentMembers, pendingThreadType, filterOutDisabledPermissions, - threadFrozenDueToBlock, useThreadFrozenDueToViewerBlock, rawThreadInfoFromServerThreadInfo, threadUIName, threadInfoFromRawThreadInfo, threadTypeDescriptions, threadIsWithBlockedUserOnlyWithoutAdminRoleCheck, - memberHasAdminPowers, roleIsDefaultRole, roleIsAdminRole, threadHasAdminRole,