Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32133962
D15530.1765026723.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
6 KB
Referenced Files
None
Subscribers
None
D15530.1765026723.diff
View Options
diff --git a/lib/shared/threads/protocols/dm-thread-protocol.js b/lib/shared/threads/protocols/dm-thread-protocol.js
--- a/lib/shared/threads/protocols/dm-thread-protocol.js
+++ b/lib/shared/threads/protocols/dm-thread-protocol.js
@@ -966,6 +966,7 @@
supportsMessageEdit: true,
supportsRelationships: true,
pinsStoredOnServer: false,
+ supportsEmojiThreadAvatars: true,
});
function pendingThreadType(numberOfOtherMembers: number) {
diff --git a/lib/shared/threads/protocols/farcaster-thread-protocol.js b/lib/shared/threads/protocols/farcaster-thread-protocol.js
--- a/lib/shared/threads/protocols/farcaster-thread-protocol.js
+++ b/lib/shared/threads/protocols/farcaster-thread-protocol.js
@@ -1117,12 +1117,12 @@
canReactToRobotext: false,
supportsThreadRefreshing: true,
temporarilyDisabledFeatures: {
- changingThreadAvatar: true,
pinningMessages: false,
},
supportsMessageEdit: false,
supportsRelationships: false,
pinsStoredOnServer: false,
+ supportsEmojiThreadAvatars: false,
};
function pendingThreadType(numberOfOtherMembers: number) {
diff --git a/lib/shared/threads/protocols/keyserver-thread-protocol.js b/lib/shared/threads/protocols/keyserver-thread-protocol.js
--- a/lib/shared/threads/protocols/keyserver-thread-protocol.js
+++ b/lib/shared/threads/protocols/keyserver-thread-protocol.js
@@ -784,6 +784,7 @@
supportsMessageEdit: true,
supportsRelationships: true,
pinsStoredOnServer: true,
+ supportsEmojiThreadAvatars: true,
});
function pendingThreadType(numberOfOtherMembers: number) {
diff --git a/lib/shared/threads/thread-spec.js b/lib/shared/threads/thread-spec.js
--- a/lib/shared/threads/thread-spec.js
+++ b/lib/shared/threads/thread-spec.js
@@ -590,12 +590,12 @@
+canReactToRobotext: boolean,
+supportsThreadRefreshing: boolean,
+temporarilyDisabledFeatures?: {
- +changingThreadAvatar?: boolean,
+pinningMessages?: boolean,
},
+supportsMessageEdit: boolean,
+supportsRelationships: boolean,
+pinsStoredOnServer: boolean,
+ +supportsEmojiThreadAvatars: boolean,
};
export type ThreadSpec<
diff --git a/native/avatars/avatar-hooks.js b/native/avatars/avatar-hooks.js
--- a/native/avatars/avatar-hooks.js
+++ b/native/avatars/avatar-hooks.js
@@ -443,7 +443,7 @@
return selectFromGalleryAndUpdateThreadAvatar;
}
-type ShowAvatarActionSheetOptions = {
+export type ShowAvatarActionSheetOptions = {
+id: 'emoji' | 'image' | 'camera' | 'ens' | 'farcaster' | 'cancel' | 'remove',
+onPress?: () => mixed,
};
diff --git a/native/avatars/edit-thread-avatar.react.js b/native/avatars/edit-thread-avatar.react.js
--- a/native/avatars/edit-thread-avatar.react.js
+++ b/native/avatars/edit-thread-avatar.react.js
@@ -15,6 +15,7 @@
} from 'lib/types/minimally-encoded-thread-permissions-types.js';
import {
+ type ShowAvatarActionSheetOptions,
useNativeSetThreadAvatar,
useSelectFromGalleryAndUpdateThreadAvatar,
useShowAvatarActionSheet,
@@ -87,11 +88,19 @@
);
const actionSheetConfig = React.useMemo(() => {
- const configOptions = [
- { id: 'emoji', onPress: navigateToThreadEmojiAvatarCreation },
+ const configOptions: Array<ShowAvatarActionSheetOptions> = [];
+
+ if (threadSpecs[threadInfo.type].protocol().supportsEmojiThreadAvatars) {
+ configOptions.push({
+ id: 'emoji',
+ onPress: navigateToThreadEmojiAvatarCreation,
+ });
+ }
+
+ configOptions.push(
{ id: 'image', onPress: selectFromGallery },
{ id: 'camera', onPress: navigateToCamera },
- ];
+ );
if (communityInfo?.farcasterChannelID) {
configOptions.push({
@@ -106,21 +115,18 @@
return configOptions;
}, [
- navigateToCamera,
- navigateToThreadEmojiAvatarCreation,
- removeAvatar,
- selectFromGallery,
+ threadInfo.type,
threadInfo.avatar,
+ selectFromGallery,
+ navigateToCamera,
communityInfo?.farcasterChannelID,
+ navigateToThreadEmojiAvatarCreation,
setFarcasterThreadAvatar,
+ removeAvatar,
]);
const showAvatarActionSheet = useShowAvatarActionSheet(actionSheetConfig);
- const isChangingAvatarDisabled =
- threadSpecs[threadInfo.type].protocol().temporarilyDisabledFeatures
- ?.changingThreadAvatar;
-
let spinner;
if (threadAvatarSaveInProgress) {
spinner = (
@@ -130,13 +136,11 @@
);
}
- const isDisabled = disabled || isChangingAvatarDisabled;
-
return (
- <TouchableOpacity onPress={showAvatarActionSheet} disabled={isDisabled}>
+ <TouchableOpacity onPress={showAvatarActionSheet} disabled={disabled}>
<ThreadAvatar threadInfo={threadInfo} size="XL" />
{spinner}
- {!isDisabled ? <EditAvatarBadge /> : null}
+ {!disabled ? <EditAvatarBadge /> : null}
</TouchableOpacity>
);
}
diff --git a/web/avatars/edit-thread-avatar-menu.react.js b/web/avatars/edit-thread-avatar-menu.react.js
--- a/web/avatars/edit-thread-avatar-menu.react.js
+++ b/web/avatars/edit-thread-avatar-menu.react.js
@@ -140,7 +140,11 @@
);
const menuItems = React.useMemo(() => {
- const items = [emojiMenuItem, imageMenuItem];
+ const items = [];
+ if (threadSpecs[threadInfo.type].protocol().supportsEmojiThreadAvatars) {
+ items.push(emojiMenuItem);
+ }
+ items.push(imageMenuItem);
if (communityInfo?.farcasterChannelID) {
items.push(farcasterMenuItem);
}
@@ -155,6 +159,7 @@
imageMenuItem,
removeMenuItem,
threadInfo.avatar,
+ threadInfo.type,
]);
return (
diff --git a/web/avatars/edit-thread-avatar.react.js b/web/avatars/edit-thread-avatar.react.js
--- a/web/avatars/edit-thread-avatar.react.js
+++ b/web/avatars/edit-thread-avatar.react.js
@@ -30,15 +30,12 @@
);
const protocol = threadSpecs[threadInfo.type].protocol();
const threadSupportAvatarEdit = protocol.supportedThreadSettings.avatar;
- const isChangingAvatarDisabled =
- protocol.temporarilyDisabledFeatures?.changingThreadAvatar;
let editThreadAvatarMenu;
if (
canEditThreadAvatar &&
!threadAvatarSaveInProgress &&
- threadSupportAvatarEdit &&
- !isChangingAvatarDisabled
+ threadSupportAvatarEdit
) {
editThreadAvatarMenu = <EditThreadAvatarMenu threadInfo={threadInfo} />;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 6, 1:12 PM (13 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5837872
Default Alt Text
D15530.1765026723.diff (6 KB)
Attached To
Mode
D15530: [lib] Enable setting all thread avatar types except emoji for Farcaster
Attached
Detach File
Event Timeline
Log In to Comment