Page MenuHomePhabricator

D11311.id38024.diff
No OneTemporary

D11311.id38024.diff

diff --git a/keyserver/src/fetchers/thread-permission-fetchers.js b/keyserver/src/fetchers/thread-permission-fetchers.js
--- a/keyserver/src/fetchers/thread-permission-fetchers.js
+++ b/keyserver/src/fetchers/thread-permission-fetchers.js
@@ -8,8 +8,8 @@
} from 'lib/permissions/thread-permissions.js';
import { relationshipBlockedInEitherDirection } from 'lib/shared/relationship-utils.js';
import {
- threadFrozenDueToBlock,
permissionsDisabledByBlock,
+ serverThreadFrozenDueToBlock,
} from 'lib/shared/thread-utils.js';
import { userRelationshipStatus } from 'lib/types/relationship-types.js';
import type {
@@ -158,7 +158,7 @@
]);
for (const threadID in threadInfos) {
- const blockedThread = threadFrozenDueToBlock(
+ const blockedThread = serverThreadFrozenDueToBlock(
threadInfos[threadID],
viewer.id,
userInfos,
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
@@ -1001,7 +1001,7 @@
viewerID: ?string,
userInfos: UserInfos,
): ThreadCurrentUserInfo {
- if (!threadFrozenDueToBlock(threadInfo, viewerID, userInfos)) {
+ if (!clientThreadFrozenDueToBlock(threadInfo, viewerID, userInfos)) {
return threadInfo.currentUser;
}
const decodedPermissions = threadPermissionsFromBitmaskHex(
@@ -1050,7 +1050,7 @@
);
}
-function threadFrozenDueToBlock(
+function serverThreadFrozenDueToBlock(
threadInfo: LegacyRawThreadInfo | RawThreadInfo | ThreadInfo,
viewerID: ?string,
userInfos: UserInfos,
@@ -1058,6 +1058,14 @@
return threadIsWithBlockedUserOnly(threadInfo, viewerID, userInfos);
}
+function clientThreadFrozenDueToBlock(
+ threadInfo: RawThreadInfo | ThreadInfo,
+ viewerID: ?string,
+ userInfos: UserInfos,
+): boolean {
+ return threadIsWithBlockedUserOnly(threadInfo, viewerID, userInfos);
+}
+
function threadFrozenDueToViewerBlock(
threadInfo: RawThreadInfo | ThreadInfo,
communityThreadInfo: ?(RawThreadInfo | ThreadInfo),
@@ -1889,7 +1897,8 @@
pendingThreadType,
createRealThreadFromPendingThread,
getMinimallyEncodedCurrentUser,
- threadFrozenDueToBlock,
+ serverThreadFrozenDueToBlock,
+ clientThreadFrozenDueToBlock,
threadFrozenDueToViewerBlock,
rawThreadInfoFromServerThreadInfo,
threadUIName,

File Metadata

Mime Type
text/plain
Expires
Wed, Dec 25, 7:33 AM (7 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2701937
Default Alt Text
D11311.id38024.diff (2 KB)

Event Timeline