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 @@ -699,6 +699,7 @@ +[inType: ThreadType]: ThreadType, }, +filterDetailedThreadEditPermissions?: boolean, + +filterThreadEditAvatarPermission?: boolean, }; function rawThreadInfoFromServerThreadInfo( serverThreadInfo: ServerThreadInfo, @@ -711,14 +712,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 = [];