Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3342269
D11311.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
D11311.diff
View Options
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,8 +1050,16 @@
);
}
-function threadFrozenDueToBlock(
- threadInfo: LegacyRawThreadInfo | RawThreadInfo | ThreadInfo,
+function serverThreadFrozenDueToBlock(
+ threadInfo: LegacyRawThreadInfo | RawThreadInfo,
+ viewerID: ?string,
+ userInfos: UserInfos,
+): boolean {
+ return threadIsWithBlockedUserOnly(threadInfo, viewerID, userInfos);
+}
+
+function clientThreadFrozenDueToBlock(
+ threadInfo: RawThreadInfo | ThreadInfo,
viewerID: ?string,
userInfos: UserInfos,
): boolean {
@@ -1889,7 +1897,8 @@
pendingThreadType,
createRealThreadFromPendingThread,
getMinimallyEncodedCurrentUser,
- threadFrozenDueToBlock,
+ serverThreadFrozenDueToBlock,
+ clientThreadFrozenDueToBlock,
threadFrozenDueToViewerBlock,
rawThreadInfoFromServerThreadInfo,
threadUIName,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 12:59 AM (18 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2566952
Default Alt Text
D11311.diff (2 KB)
Attached To
Mode
D11311: [lib] Separate `serverThreadFrozenDueToBlock` and `clientThreadFrozenDueToBlock`
Attached
Detach File
Event Timeline
Log In to Comment