Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3174829
D13253.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
D13253.diff
View Options
diff --git a/lib/shared/thread-utils.js b/lib/shared/thread-utils.js
--- a/lib/shared/thread-utils.js
+++ b/lib/shared/thread-utils.js
@@ -607,9 +607,13 @@
username: username,
};
+ const threadType = usingOlmViaTunnelbrokerForDMs
+ ? threadTypes.PERSONAL
+ : threadTypes.GENESIS_PERSONAL;
+
const threadInfo = createPendingThread({
viewerID: loggedInUserInfo.id,
- threadType: threadTypes.GENESIS_PERSONAL,
+ threadType,
members: [loggedInUserInfo, pendingPersonalThreadUserInfo],
});
@@ -1512,9 +1516,13 @@
return threadInfo;
}
members.push(...mentionedNewMembers);
+ const threadType = threadTypeIsThick(parentThreadInfo.type)
+ ? threadTypes.THICK_SIDEBAR
+ : threadTypes.SIDEBAR;
+
return createPendingThread({
viewerID,
- threadType: threadTypes.SIDEBAR,
+ threadType,
members,
parentThreadInfo,
threadColor: threadInfo.color,
diff --git a/native/chat/chat-thread-list.react.js b/native/chat/chat-thread-list.react.js
--- a/native/chat/chat-thread-list.react.js
+++ b/native/chat/chat-thread-list.react.js
@@ -35,6 +35,7 @@
import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadTypes } from 'lib/types/thread-types-enum.js';
import type { UserInfo } from 'lib/types/user-types.js';
+import { usingOlmViaTunnelbrokerForDMs } from 'lib/utils/services-utils.js';
import { ChatThreadListItem } from './chat-thread-list-item.react.js';
import ChatThreadListSearch from './chat-thread-list-search.react.js';
@@ -135,9 +136,12 @@
if (!loggedInUserInfo) {
return;
}
+ const threadType = usingOlmViaTunnelbrokerForDMs
+ ? threadTypes.PRIVATE
+ : threadTypes.GENESIS_PRIVATE;
const threadInfo = createPendingThread({
viewerID: loggedInUserInfo.id,
- threadType: threadTypes.GENESIS_PRIVATE,
+ threadType,
members: [loggedInUserInfo],
});
navigateToThread({ threadInfo, searching: true });
diff --git a/native/chat/compose-thread-button.react.js b/native/chat/compose-thread-button.react.js
--- a/native/chat/compose-thread-button.react.js
+++ b/native/chat/compose-thread-button.react.js
@@ -6,6 +6,7 @@
import { useLoggedInUserInfo } from 'lib/hooks/account-hooks.js';
import { createPendingThread } from 'lib/shared/thread-utils.js';
import { threadTypes } from 'lib/types/thread-types-enum.js';
+import { usingOlmViaTunnelbrokerForDMs } from 'lib/utils/services-utils.js';
import type { ChatNavigationProp } from './chat.react.js';
import Button from '../components/button.react.js';
@@ -23,12 +24,15 @@
if (!loggedInUserInfo) {
return;
}
+ const threadType = usingOlmViaTunnelbrokerForDMs
+ ? threadTypes.PRIVATE
+ : threadTypes.GENESIS_PRIVATE;
navigate<'MessageList'>({
name: MessageListRouteName,
params: {
threadInfo: createPendingThread({
viewerID: loggedInUserInfo.id,
- threadType: threadTypes.GENESIS_PRIVATE,
+ threadType,
members: [loggedInUserInfo],
}),
searching: true,
diff --git a/web/utils/thread-utils.js b/web/utils/thread-utils.js
--- a/web/utils/thread-utils.js
+++ b/web/utils/thread-utils.js
@@ -13,6 +13,7 @@
import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadTypes } from 'lib/types/thread-types-enum.js';
import type { AccountUserInfo } from 'lib/types/user-types.js';
+import { usingOlmViaTunnelbrokerForDMs } from 'lib/utils/services-utils.js';
import { useSelector } from '../redux/redux-utils.js';
@@ -53,18 +54,22 @@
}),
);
+ const threadType = usingOlmViaTunnelbrokerForDMs
+ ? threadTypes.PRIVATE
+ : threadTypes.GENESIS_PRIVATE;
+
const newThreadID = 'pending/new_thread';
const pendingNewThread = React.useMemo(
() => ({
...createPendingThread({
viewerID: loggedInUserInfo.id,
- threadType: threadTypes.GENESIS_PRIVATE,
+ threadType,
members: [loggedInUserInfo],
name: 'New thread',
}),
id: newThreadID,
}),
- [loggedInUserInfo],
+ [loggedInUserInfo, threadType],
);
const existingThreadInfoFinderForCreatingThread = useExistingThreadInfoFinder(
pendingPrivateThread.current,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 8, 6:20 PM (19 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2444917
Default Alt Text
D13253.diff (4 KB)
Attached To
Mode
D13253: [lib][web][native] Update createPendingThread usages
Attached
Detach File
Event Timeline
Log In to Comment