Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3357235
D7364.id24838.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
D7364.id24838.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
@@ -160,6 +160,11 @@
viewer.platformDetails,
104,
);
+
+ // TODO (atul): Replace with `hasMinCodeVersion` check once we have a
+ // native release with thread avatar editing enabled.
+ const filterThreadEditAvatarPermission = true;
+
const threadInfos = {};
for (const threadID in serverResult.threadInfos) {
const serverThreadInfo = serverResult.threadInfos[threadID];
@@ -172,6 +177,7 @@
shimThreadTypes: hasCodeVersionBelow87 ? shimCommunityRoot : null,
hideThreadStructure: hasCodeVersionBelow102,
filterDetailedThreadEditPermissions: hasCodeVersionBelow104,
+ filterThreadEditAvatarPermission,
},
);
if (threadInfo) {
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
@@ -698,6 +698,7 @@
+[inType: ThreadType]: ThreadType,
},
+filterDetailedThreadEditPermissions?: boolean,
+ +filterThreadEditAvatarPermission?: boolean,
};
function rawThreadInfoFromServerThreadInfo(
serverThreadInfo: ServerThreadInfo,
@@ -710,14 +711,18 @@
const shimThreadTypes = options?.shimThreadTypes;
const filterDetailedThreadEditPermissions =
options?.filterDetailedThreadEditPermissions;
+ const filterThreadEditAvatarPermission =
+ options?.filterThreadEditAvatarPermission;
const filterThreadPermissions = _omitBy(
(v, k) =>
- filterDetailedThreadEditPermissions &&
- [
- threadPermissions.EDIT_THREAD_COLOR,
- threadPermissions.EDIT_THREAD_DESCRIPTION,
- ].includes(k),
+ (filterDetailedThreadEditPermissions &&
+ [
+ threadPermissions.EDIT_THREAD_COLOR,
+ threadPermissions.EDIT_THREAD_DESCRIPTION,
+ ].includes(k)) ||
+ (filterThreadEditAvatarPermission &&
+ [threadPermissions.EDIT_THREAD_AVATAR].includes(k)),
);
const members = [];
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 10:58 PM (20 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2577570
Default Alt Text
D7364.id24838.diff (2 KB)
Attached To
Mode
D7364: [lib] Update `filterThreadPermissions` to handle `EDIT_THREAD_AVATAR`
Attached
Detach File
Event Timeline
Log In to Comment