Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3356861
D7364.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.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
@@ -70,6 +70,7 @@
threadPermissions,
threadTypeIsCommunityRoot,
assertThreadType,
+ threadPermissionPropagationPrefixes,
} from '../types/thread-types.js';
import { type ClientUpdateInfo, updateTypes } from '../types/update-types.js';
import type {
@@ -699,6 +700,7 @@
+[inType: ThreadType]: ThreadType,
},
+filterDetailedThreadEditPermissions?: boolean,
+ +filterThreadEditAvatarPermission?: boolean,
};
function rawThreadInfoFromServerThreadInfo(
serverThreadInfo: ServerThreadInfo,
@@ -711,14 +713,22 @@
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,
+ threadPermissionPropagationPrefixes.DESCENDANT +
+ threadPermissions.EDIT_THREAD_AVATAR,
+ ].includes(k)),
);
const members = [];
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 9:06 PM (18 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2577325
Default Alt Text
D7364.diff (2 KB)
Attached To
Mode
D7364: [lib] Update `filterThreadPermissions` to handle `EDIT_THREAD_AVATAR`
Attached
Detach File
Event Timeline
Log In to Comment