Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33247504
D15476.1768574772.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
7 KB
Referenced Files
None
Subscribers
None
D15476.1768574772.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
@@ -953,6 +953,7 @@
canReactToRobotext: true,
supportsThreadRefreshing: false,
supportsMessageEdit: true,
+ supportsRelationships: 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
@@ -1000,6 +1000,7 @@
pinningMessages: true,
},
supportsMessageEdit: false,
+ supportsRelationships: 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
@@ -756,6 +756,7 @@
canReactToRobotext: true,
supportsThreadRefreshing: false,
supportsMessageEdit: true,
+ supportsRelationships: 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
@@ -552,6 +552,7 @@
+pinningMessages?: boolean,
},
+supportsMessageEdit: boolean,
+ +supportsRelationships: boolean,
};
export type ThreadSpec<
diff --git a/native/chat/message-list-container.react.js b/native/chat/message-list-container.react.js
--- a/native/chat/message-list-container.react.js
+++ b/native/chat/message-list-container.react.js
@@ -448,7 +448,10 @@
);
let relationshipPrompt = null;
- if (threadTypeIsPersonal(threadInfo.type)) {
+ if (
+ threadTypeIsPersonal(threadInfo.type) &&
+ threadSpecs[threadInfo.type].protocol().supportsRelationships
+ ) {
relationshipPrompt = (
<RelationshipPrompt
pendingPersonalThreadUserInfo={
diff --git a/native/chat/settings/thread-settings.react.js b/native/chat/settings/thread-settings.react.js
--- a/native/chat/settings/thread-settings.react.js
+++ b/native/chat/settings/thread-settings.react.js
@@ -800,7 +800,12 @@
});
}
- if (threadInfo && threadTypeIsPersonal(threadInfo.type) && viewerID) {
+ if (
+ threadInfo &&
+ threadTypeIsPersonal(threadInfo.type) &&
+ viewerID &&
+ threadSpecs[threadInfo.type].protocol().supportsRelationships
+ ) {
const otherMemberID = getSingleOtherUser(threadInfo, viewerID);
if (otherMemberID) {
const otherUserInfo = userInfos[otherMemberID];
diff --git a/native/user-profile/user-profile.react.js b/native/user-profile/user-profile.react.js
--- a/native/user-profile/user-profile.react.js
+++ b/native/user-profile/user-profile.react.js
@@ -7,6 +7,7 @@
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { useResolvableNames } from 'lib/hooks/names-cache.js';
+import { isFarcasterUserID } from 'lib/shared/id-utils.js';
import { relationshipBlockedInEitherDirection } from 'lib/shared/relationship-utils.js';
import { useUserProfileThreadInfo } from 'lib/shared/thread-utils.js';
import {
@@ -184,7 +185,9 @@
const relationshipButton = React.useMemo(() => {
if (
!userProfileThreadInfo ||
- relationshipBlockedInEitherDirection(userInfo?.relationshipStatus)
+ relationshipBlockedInEitherDirection(userInfo?.relationshipStatus) ||
+ !userInfo?.id ||
+ isFarcasterUserID(userInfo.id)
) {
return null;
}
@@ -199,7 +202,7 @@
}
/>
);
- }, [userInfo?.relationshipStatus, userProfileThreadInfo]);
+ }, [userInfo?.relationshipStatus, userProfileThreadInfo, userInfo?.id]);
return (
<View style={styles.container}>
diff --git a/web/chat/chat-message-list.react.js b/web/chat/chat-message-list.react.js
--- a/web/chat/chat-message-list.react.js
+++ b/web/chat/chat-message-list.react.js
@@ -17,7 +17,10 @@
threadIsPending,
threadOtherMembers,
} from 'lib/shared/thread-utils.js';
-import { threadTypeIsPersonal } from 'lib/shared/threads/thread-specs.js';
+import {
+ threadSpecs,
+ threadTypeIsPersonal,
+} from 'lib/shared/threads/thread-specs.js';
import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { defaultMaxTextAreaHeight, editBoxHeight } from './chat-constants.js';
@@ -293,7 +296,10 @@
const messages = messageListData.map(this.renderItem);
let relationshipPrompt = null;
- if (threadTypeIsPersonal(threadInfo.type)) {
+ if (
+ threadTypeIsPersonal(threadInfo.type) &&
+ threadSpecs[threadInfo.type].protocol().supportsRelationships
+ ) {
const otherMembers = threadOtherMembers(
threadInfo.members,
this.props.viewerID,
diff --git a/web/modals/threads/settings/thread-settings-modal.react.js b/web/modals/threads/settings/thread-settings-modal.react.js
--- a/web/modals/threads/settings/thread-settings-modal.react.js
+++ b/web/modals/threads/settings/thread-settings-modal.react.js
@@ -16,7 +16,10 @@
threadUIName,
useThreadHasPermission,
} from 'lib/shared/thread-utils.js';
-import { threadTypeIsPersonal } from 'lib/shared/threads/thread-specs.js';
+import {
+ threadSpecs,
+ threadTypeIsPersonal,
+} from 'lib/shared/threads/thread-specs.js';
import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import type { RelationshipButton } from 'lib/types/relationship-types.js';
import { threadPermissions } from 'lib/types/thread-permission-types.js';
@@ -95,7 +98,8 @@
if (
!otherUserInfo ||
!threadInfo?.type ||
- !threadTypeIsPersonal(threadInfo.type)
+ !threadTypeIsPersonal(threadInfo.type) ||
+ !threadSpecs[threadInfo.type].protocol().supportsRelationships
) {
return ([]: RelationshipButton[]);
}
diff --git a/web/modals/user-profile/user-profile-action-buttons.react.js b/web/modals/user-profile/user-profile-action-buttons.react.js
--- a/web/modals/user-profile/user-profile-action-buttons.react.js
+++ b/web/modals/user-profile/user-profile-action-buttons.react.js
@@ -4,6 +4,7 @@
import * as React from 'react';
import { useRelationshipPrompt } from 'lib/hooks/relationship-prompt.js';
+import { isFarcasterUserID } from 'lib/shared/id-utils.js';
import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { userRelationshipStatus } from 'lib/types/relationship-types.js';
@@ -28,7 +29,8 @@
const userProfileActionButtons = React.useMemo(() => {
if (
!otherUserInfo ||
- otherUserInfo.relationshipStatus === userRelationshipStatus.FRIEND
+ otherUserInfo.relationshipStatus === userRelationshipStatus.FRIEND ||
+ isFarcasterUserID(otherUserInfo.id)
) {
return <UserProfileMessageButton threadInfo={threadInfo} />;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 16, 2:46 PM (1 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5940241
Default Alt Text
D15476.1768574772.diff (7 KB)
Attached To
Mode
D15476: [lib][web][native] hide relationship buttons for Farcaster threads
Attached
Detach File
Event Timeline
Log In to Comment