Page MenuHomePhabricator

D12554.id41764.diff
No OneTemporary

D12554.id41764.diff

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
@@ -985,26 +985,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,
@@ -1022,14 +1002,6 @@
);
}
-function threadFrozenDueToBlock(
- threadInfo: LegacyRawThreadInfo | RawThreadInfo,
- viewerID: ?string,
- userInfos: UserInfos,
-): boolean {
- return threadIsWithBlockedUserOnly(threadInfo, viewerID, userInfos, false);
-}
-
function useThreadFrozenDueToViewerBlock(
threadInfo: ThreadInfo,
communityThreadInfo: ?ThreadInfo,
@@ -1070,19 +1042,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 {
@@ -1125,16 +1084,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<ClientUpdateInfo>,
): Set<string> {
@@ -1747,14 +1696,12 @@
extractNewMentionedParentMembers,
pendingThreadType,
filterOutDisabledPermissions,
- threadFrozenDueToBlock,
useThreadFrozenDueToViewerBlock,
rawThreadInfoFromServerThreadInfo,
threadUIName,
threadInfoFromRawThreadInfo,
threadTypeDescriptions,
threadIsWithBlockedUserOnlyWithoutAdminRoleCheck,
- memberHasAdminPowers,
roleIsDefaultRole,
roleIsAdminRole,
threadHasAdminRole,

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 17, 9:24 AM (20 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2521465
Default Alt Text
D12554.id41764.diff (2 KB)

Event Timeline