Page MenuHomePhabricator

D13538.id44719.diff
No OneTemporary

D13538.id44719.diff

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
@@ -601,7 +601,7 @@
+pendingPersonalThreadUserInfo: UserInfo,
};
-function createPendingPersonalThread(
+function createPendingPersonalOrPrivateThread(
loggedInUserInfo: LoggedInUserInfo,
userID: string,
username: ?string,
@@ -612,14 +612,23 @@
username: username,
};
- const threadType = supportThickThreads
- ? threadTypes.PERSONAL
- : threadTypes.GENESIS_PERSONAL;
+ const members: Array<UserIDAndUsername> = [loggedInUserInfo];
+ let threadType;
+ if (loggedInUserInfo.id === userID) {
+ threadType = supportThickThreads
+ ? threadTypes.PRIVATE
+ : threadTypes.GENESIS_PRIVATE;
+ } else {
+ threadType = supportThickThreads
+ ? threadTypes.PERSONAL
+ : threadTypes.GENESIS_PERSONAL;
+ members.push(pendingPersonalThreadUserInfo);
+ }
const threadInfo = createPendingThread({
viewerID: loggedInUserInfo.id,
threadType,
- members: [loggedInUserInfo, pendingPersonalThreadUserInfo],
+ members,
});
return { threadInfo, pendingPersonalThreadUserInfo };
@@ -631,7 +640,7 @@
supportThickThreads: boolean,
): ChatThreadItem {
const { threadInfo, pendingPersonalThreadUserInfo } =
- createPendingPersonalThread(
+ createPendingPersonalOrPrivateThread(
loggedInUserInfo,
user.id,
user.username,
@@ -1747,7 +1756,7 @@
return personalThreadInfo ? { threadInfo: personalThreadInfo } : null;
}
- const pendingPersonalThreadInfo = createPendingPersonalThread(
+ const pendingPersonalThreadInfo = createPendingPersonalOrPrivateThread(
loggedInUserInfo,
userID,
username,

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 20, 8:53 AM (16 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2543861
Default Alt Text
D13538.id44719.diff (1 KB)

Event Timeline