Page MenuHomePhabricator

D7364.id24838.diff
No OneTemporary

D7364.id24838.diff

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

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)

Event Timeline