Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32160907
D15288.1765041814.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D15288.1765041814.diff
View Options
diff --git a/lib/shared/search-utils.js b/lib/shared/search-utils.js
--- a/lib/shared/search-utils.js
+++ b/lib/shared/search-utils.js
@@ -2,7 +2,7 @@
import * as React from 'react';
-import { messageID } from './id-utils.js';
+import { messageID, extractFIDFromUserID } from './id-utils.js';
import SearchIndex from './search-index.js';
import {
getContainingThreadID,
@@ -47,6 +47,7 @@
import { values } from '../utils/objects.js';
import { useDispatchActionPromise } from '../utils/redux-promise-utils.js';
import { useSelector } from '../utils/redux-utils.js';
+import { supportsFarcasterDCs } from '../utils/services-utils.js';
const notFriendNotice = 'not friend';
@@ -282,6 +283,8 @@
}) => {
let notice, alert;
const username = result.username;
+ const isFarcasterUser =
+ supportsFarcasterDCs && !!extractFIDFromUserID(result.id);
if (
relationshipStatus &&
relationshipBlockedInEitherDirection(relationshipStatus)
@@ -309,6 +312,7 @@
};
}
} else if (
+ !isFarcasterUser &&
!containingThreadInfo &&
relationshipStatus !== userRelationshipStatus.FRIEND &&
result.id !== viewerID
diff --git a/native/chat/message-list-thread-search.react.js b/native/chat/message-list-thread-search.react.js
--- a/native/chat/message-list-thread-search.react.js
+++ b/native/chat/message-list-thread-search.react.js
@@ -4,8 +4,10 @@
import { Text, View } from 'react-native';
import { useENSNames } from 'lib/hooks/ens-cache.js';
+import { extractFIDFromUserID } from 'lib/shared/id-utils.js';
import { notFriendNotice } from 'lib/shared/search-utils.js';
import type { AccountUserInfo, UserListItem } from 'lib/types/user-types.js';
+import { supportsFarcasterDCs } from 'lib/utils/services-utils.js';
import { createTagInput } from '../components/tag-input.react.js';
import UserList from '../components/user-list.react.js';
@@ -67,7 +69,12 @@
return;
}
}
- if (nonFriends.has(userInfo.id) || userInfo.id === viewerID) {
+ const isFarcasterUser =
+ supportsFarcasterDCs && !!extractFIDFromUserID(userInfo.id);
+ if (
+ (!isFarcasterUser && nonFriends.has(userInfo.id)) ||
+ userInfo.id === viewerID
+ ) {
await resolveToUser(userInfo);
return;
}
diff --git a/web/chat/chat-thread-composer.react.js b/web/chat/chat-thread-composer.react.js
--- a/web/chat/chat-thread-composer.react.js
+++ b/web/chat/chat-thread-composer.react.js
@@ -14,6 +14,7 @@
useUsersSupportThickThreads,
} from 'lib/hooks/user-identities-hooks.js';
import { userInfoSelectorForPotentialMembers } from 'lib/selectors/user-selectors.js';
+import { extractFIDFromUserID } from 'lib/shared/id-utils.js';
import {
usePotentialMemberItems,
useSearchUsers,
@@ -27,6 +28,7 @@
import { threadTypes } from 'lib/types/thread-types-enum.js';
import type { AccountUserInfo, UserListItem } from 'lib/types/user-types.js';
import { useDispatch } from 'lib/utils/redux-utils.js';
+import { supportsFarcasterDCs } from 'lib/utils/services-utils.js';
import css from './chat-thread-composer.css';
import UserAvatar from '../avatars/user-avatar.react.js';
@@ -101,8 +103,11 @@
async (userListItem: UserListItem) => {
const { alert, notice, disabled, ...user } = userListItem;
setUsernameInputText('');
+ const isFarcasterUser =
+ supportsFarcasterDCs && !!extractFIDFromUserID(user.id);
if (
- (notice === notFriendNotice || user.id === viewerID) &&
+ ((!isFarcasterUser && notice === notFriendNotice) ||
+ user.id === viewerID) &&
userInfoInputArray.length === 0
) {
const newUserInfo = {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 6, 5:23 PM (22 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5839773
Default Alt Text
D15288.1765041814.diff (3 KB)
Attached To
Mode
D15288: [lib][native][web] Allow creating Farcaster threads with non-friends
Attached
Detach File
Event Timeline
Log In to Comment