Page MenuHomePhorge

D12154.1765350626.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D12154.1765350626.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
@@ -172,10 +172,11 @@
return hasPermission(threadInfo.currentUser.permissions, permission);
}
- const threadFrozen = threadFrozenDueToBlock(
+ const threadFrozen = innerThreadFrozenDueToBlock(
threadInfo,
loggedInUserInfo.id,
userInfos,
+ true,
);
const permissions = threadFrozen
@@ -880,10 +881,11 @@
viewerID: ?string,
userInfos: UserInfos,
checkOnlyViewerBlock: boolean,
+ skipMemberAdminRoleCheck: boolean,
): boolean {
if (
threadOrParentThreadIsGroupChat(threadInfo) ||
- threadOrParentThreadHasAdminRole(threadInfo)
+ (!skipMemberAdminRoleCheck && threadOrParentThreadHasAdminRole(threadInfo))
) {
return false;
}
@@ -907,12 +909,27 @@
);
}
+function innerThreadFrozenDueToBlock(
+ threadInfo: LegacyRawThreadInfo | RawThreadInfo | ThreadInfo,
+ viewerID: ?string,
+ userInfos: UserInfos,
+ skipMemberAdminRoleCheck: boolean,
+): boolean {
+ return threadIsWithBlockedUserOnly(
+ threadInfo,
+ viewerID,
+ userInfos,
+ false,
+ skipMemberAdminRoleCheck,
+ );
+}
+
function threadFrozenDueToBlock(
threadInfo: LegacyRawThreadInfo | RawThreadInfo | ThreadInfo,
viewerID: ?string,
userInfos: UserInfos,
): boolean {
- return threadIsWithBlockedUserOnly(threadInfo, viewerID, userInfos, false);
+ return innerThreadFrozenDueToBlock(threadInfo, viewerID, userInfos, false);
}
function threadFrozenDueToViewerBlock(
@@ -921,7 +938,13 @@
viewerID: ?string,
userInfos: UserInfos,
): boolean {
- return threadIsWithBlockedUserOnly(threadInfo, viewerID, userInfos, true);
+ return threadIsWithBlockedUserOnly(
+ threadInfo,
+ viewerID,
+ userInfos,
+ true,
+ false,
+ );
}
const threadTypeDescriptions: { [ThreadType]: string } = {

File Metadata

Mime Type
text/plain
Expires
Wed, Dec 10, 7:10 AM (21 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5861937
Default Alt Text
D12154.1765350626.diff (1 KB)

Event Timeline