Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3349469
D13852.id45841.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.id45841.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, {
+ addKnowOfPermission: true,
+ });
+}
+
function rawThreadInfosFromServerThreadInfos(
viewer: Viewer,
serverResult: FetchServerThreadInfosResult,
+ options?: { addKnowOfPermission?: boolean },
): FetchThreadInfosResult {
const viewerID = viewer.id;
+ const addKnowOfPermission = options?.addKnowOfPermission ?? false;
const codeVersionBelow209 = !hasMinCodeVersion(viewer.platformDetails, {
native: 209,
});
@@ -337,6 +349,7 @@
manageFarcasterChannelTagsPermissionUnsupported,
stripMemberPermissions: stripMemberPermissions,
canDisplayFarcasterThreadAvatars,
+ addKnowOfPermission,
},
);
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,
+ +addKnowOfPermission?: boolean,
};
function rawThreadInfoFromServerThreadInfo(
@@ -785,6 +786,7 @@
const stripMemberPermissions = options?.stripMemberPermissions;
const canDisplayFarcasterThreadAvatars =
options?.canDisplayFarcasterThreadAvatars;
+ const addKnowOfPermission = options?.addKnowOfPermission;
const filterThreadPermissions = (
innerThreadPermissions: ThreadPermissionsInfo,
@@ -802,6 +804,15 @@
},
};
}
+ if (addKnowOfPermission) {
+ innerThreadPermissions = {
+ ...innerThreadPermissions,
+ [threadPermissions.KNOW_OF]: {
+ value: true,
+ source: serverThreadInfo.id,
+ },
+ };
+ }
return _omitBy(
(v, k) =>
(filterThreadEditAvatarPermission &&
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 6:05 PM (12 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2571909
Default Alt Text
D13852.id45841.diff (2 KB)
Attached To
Mode
D13852: [keyserver] new fetchPrivilegedThreadInfos function
Attached
Detach File
Event Timeline
Log In to Comment