Page MenuHomePhabricator

D13749.diff
No OneTemporary

D13749.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
@@ -10,7 +10,10 @@
getContainingThreadID,
getCommunity,
} from 'lib/shared/thread-utils.js';
-import { hasMinCodeVersion } from 'lib/shared/version-utils.js';
+import {
+ hasMinCodeVersion,
+ NEXT_CODE_VERSION,
+} from 'lib/shared/version-utils.js';
import type { AvatarDBContent, ClientAvatar } from 'lib/types/avatar-types.js';
import type { RawMessageInfo, MessageInfo } from 'lib/types/message-types.js';
import type { ThinRawThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
@@ -309,6 +312,13 @@
native: 379,
web: 130,
});
+ const canDisplayFarcasterThreadAvatars = hasMinCodeVersion(
+ viewer.platformDetails,
+ {
+ native: NEXT_CODE_VERSION,
+ web: NEXT_CODE_VERSION,
+ },
+ );
const threadInfos: {
[string]: LegacyThinRawThreadInfo | ThinRawThreadInfo,
@@ -329,6 +339,7 @@
filterManageFarcasterChannelTagsPermission:
manageFarcasterChannelTagsPermissionUnsupported,
stripMemberPermissions: stripMemberPermissions,
+ canDisplayFarcasterThreadAvatars,
},
);
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
@@ -761,6 +761,7 @@
+allowAddingUsersToCommunityRoot?: boolean,
+filterManageFarcasterChannelTagsPermission?: boolean,
+stripMemberPermissions?: boolean,
+ +canDisplayFarcasterThreadAvatars?: boolean,
};
function rawThreadInfoFromServerThreadInfo(
@@ -783,6 +784,8 @@
const filterManageFarcasterChannelTagsPermission =
options?.filterManageFarcasterChannelTagsPermission;
const stripMemberPermissions = options?.stripMemberPermissions;
+ const canDisplayFarcasterThreadAvatars =
+ options?.canDisplayFarcasterThreadAvatars;
const filterThreadPermissions = (
innerThreadPermissions: ThreadPermissionsInfo,
@@ -905,7 +908,12 @@
rawThreadInfo = { ...rawThreadInfo, sourceMessageID };
}
if (serverThreadInfo.avatar) {
- rawThreadInfo = { ...rawThreadInfo, avatar: serverThreadInfo.avatar };
+ const avatar =
+ serverThreadInfo.avatar.type === 'farcaster' &&
+ !canDisplayFarcasterThreadAvatars
+ ? null
+ : serverThreadInfo.avatar;
+ rawThreadInfo = { ...rawThreadInfo, avatar };
}
if (!excludePinInfo) {
rawThreadInfo = {

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 22, 5:22 PM (18 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2563148
Default Alt Text
D13749.diff (2 KB)

Event Timeline