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 = ( { 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 ( 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 ; }