Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3280896
D12554.id41764.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D12554.id41764.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D12554: [lib] Remove `threadFrozenDueToBlock`, `threadOrParentThreadHasAdminRole` and `memberHadAdminPowers`
Attached
Detach File
Event Timeline
Log In to Comment