Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3311477
D13545.id44759.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D13545.id44759.diff
View Options
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
@@ -162,8 +162,6 @@
let searchComponent = null;
if (searching) {
const { userInfoInputArray, genesisThreadInfo } = this.props;
- // It's technically possible for the client to be missing the Genesis
- // ThreadInfo when it first opens up (before the server delivers it)
let parentThreadHeader;
if (threadTypeIsThick(threadInfo.type)) {
parentThreadHeader = (
@@ -175,6 +173,8 @@
/>
);
} else if (genesisThreadInfo) {
+ // It's technically possible for the client to be missing the Genesis
+ // ThreadInfo when it first opens up (before the server delivers it)
parentThreadHeader = (
<ParentThreadHeader
parentThreadInfo={genesisThreadInfo}
@@ -380,13 +380,15 @@
const { editInputMessage } = inputState;
const resolveToUser = React.useCallback(
async (user: AccountUserInfo) => {
- const usersSupportingThickThreads = await checkUsersThickThreadSupport([
- user.id,
- ]);
+ const newUserInfoInputArray = user.id === viewerID ? [] : [user];
+ const usersSupportingThickThreads = await checkUsersThickThreadSupport(
+ newUserInfoInputArray.map(userInfo => userInfo.id),
+ );
const resolvedThreadInfo = existingThreadInfoFinder({
searching: true,
- userInfoInputArray: [user],
- allUsersSupportThickThreads: usersSupportingThickThreads.has(user.id),
+ userInfoInputArray: newUserInfoInputArray,
+ allUsersSupportThickThreads:
+ user.id === viewerID || usersSupportingThickThreads.has(user.id),
});
invariant(
resolvedThreadInfo,
@@ -398,6 +400,7 @@
},
[
checkUsersThickThreadSupport,
+ viewerID,
editInputMessage,
existingThreadInfoFinder,
setParams,
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
@@ -9,6 +9,7 @@
import { createTagInput } from '../components/tag-input.react.js';
import UserList from '../components/user-list.react.js';
+import { useSelector } from '../redux/redux-utils.js';
import { useStyles } from '../themes/colors.js';
const TagInput = createTagInput<AccountUserInfo>();
@@ -58,6 +59,7 @@
return [userListItemsArr, nonFriendsSet];
}, [userSearchResults, userInfoInputArray]);
+ const viewerID = useSelector(state => state.currentUserInfo?.id);
const onUserSelect = React.useCallback(
async (userInfo: AccountUserInfo) => {
for (const existingUserInfo of userInfoInputArray) {
@@ -65,7 +67,7 @@
return;
}
}
- if (nonFriends.has(userInfo.id)) {
+ if (nonFriends.has(userInfo.id) || userInfo.id === viewerID) {
await resolveToUser(userInfo);
return;
}
@@ -79,6 +81,7 @@
updateTagInput,
resolveToUser,
updateUsernameInput,
+ viewerID,
],
);
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
@@ -97,19 +97,25 @@
async (userListItem: UserListItem) => {
const { alert, notice, disabled, ...user } = userListItem;
setUsernameInputText('');
- if (notice === notFriendNotice && userInfoInputArray.length === 0) {
- const newUserInfoInputArray = [
- { id: userListItem.id, username: userListItem.username },
- ];
+ if (
+ (notice === notFriendNotice || user.id === viewerID) &&
+ userInfoInputArray.length === 0
+ ) {
+ const newUserInfo = {
+ id: userListItem.id,
+ username: userListItem.username,
+ };
+ const newUserInfoInputArray = user.id === viewerID ? [] : [newUserInfo];
const usersSupportingThickThreads = await checkUsersThickThreadSupport(
newUserInfoInputArray.map(userInfo => userInfo.id),
);
const threadInfo = existingThreadInfoFinderForCreatingThread({
searching: true,
userInfoInputArray: newUserInfoInputArray,
- allUsersSupportThickThreads: newUserInfoInputArray.every(userInfo =>
- usersSupportingThickThreads.has(userInfo.id),
- ),
+ allUsersSupportThickThreads:
+ user.id === viewerID
+ ? true
+ : usersSupportingThickThreads.has(user.id),
});
dispatch({
type: updateNavInfoActionType,
@@ -133,6 +139,7 @@
[
checkUsersThickThreadSupport,
dispatch,
+ viewerID,
existingThreadInfoFinderForCreatingThread,
pushModal,
userInfoInputArray,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 20, 8:57 AM (21 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2543858
Default Alt Text
D13545.id44759.diff (4 KB)
Attached To
Mode
D13545: [native][web] Go to PRIVATE chat when the user selects themselves in chat composer
Attached
Detach File
Event Timeline
Log In to Comment