Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3337885
D13749.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
D13749.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
@@ -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
Details
Attached
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)
Attached To
Mode
D13749: [lib] modify rawThreadInfoFromServerThreadInfo to return default avatar to old clients
Attached
Detach File
Event Timeline
Log In to Comment