diff --git a/keyserver/src/fetchers/thread-fetchers.js b/keyserver/src/fetchers/thread-fetchers.js --- a/keyserver/src/fetchers/thread-fetchers.js +++ b/keyserver/src/fetchers/thread-fetchers.js @@ -266,11 +266,23 @@ return rawThreadInfosFromServerThreadInfos(viewer, serverResult); } +async function fetchPrivilegedThreadInfos( + viewer: Viewer, + inputFilter?: FetchThreadInfosFilter, +): Promise { + const serverResult = await fetchServerThreadInfos(inputFilter); + return rawThreadInfosFromServerThreadInfos(viewer, serverResult, { + dontFilterMissingKnowOf: true, + }); +} + function rawThreadInfosFromServerThreadInfos( viewer: Viewer, serverResult: FetchServerThreadInfosResult, + options?: { +dontFilterMissingKnowOf?: boolean }, ): FetchThreadInfosResult { const viewerID = viewer.id; + const dontFilterMissingKnowOf = options?.dontFilterMissingKnowOf ?? false; const codeVersionBelow209 = !hasMinCodeVersion(viewer.platformDetails, { native: 209, }); @@ -337,6 +349,7 @@ manageFarcasterChannelTagsPermissionUnsupported, stripMemberPermissions: stripMemberPermissions, canDisplayFarcasterThreadAvatars, + dontFilterMissingKnowOf, }, ); if (threadInfo) { @@ -463,6 +476,7 @@ export { fetchServerThreadInfos, + fetchPrivilegedThreadInfos, fetchThreadInfos, rawThreadInfosFromServerThreadInfos, verifyThreadIDs, 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 @@ -761,6 +761,7 @@ +filterManageFarcasterChannelTagsPermission?: boolean, +stripMemberPermissions?: boolean, +canDisplayFarcasterThreadAvatars?: boolean, + +dontFilterMissingKnowOf?: boolean, }; function rawThreadInfoFromServerThreadInfo( @@ -785,6 +786,7 @@ const stripMemberPermissions = options?.stripMemberPermissions; const canDisplayFarcasterThreadAvatars = options?.canDisplayFarcasterThreadAvatars; + const dontFilterMissingKnowOf = options?.dontFilterMissingKnowOf ?? false; const filterThreadPermissions = ( innerThreadPermissions: ThreadPermissionsInfo, @@ -873,7 +875,10 @@ unread: null, }; } - if (!permissionLookup(currentUserPermissions, threadPermissions.KNOW_OF)) { + if ( + !dontFilterMissingKnowOf && + !permissionLookup(currentUserPermissions, threadPermissions.KNOW_OF) + ) { return null; }