Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3332965
D13852.id45891.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
D13852.id45891.diff
View Options
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<FetchThreadInfosResult> {
+ 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;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 22, 2:58 AM (2 m, 21 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2559244
Default Alt Text
D13852.id45891.diff (2 KB)
Attached To
Mode
D13852: [keyserver] new fetchPrivilegedThreadInfos function
Attached
Detach File
Event Timeline
Log In to Comment