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,