Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3311479
D13535.id44764.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
D13535.id44764.diff
View Options
diff --git a/keyserver/src/creators/account-creator.js b/keyserver/src/creators/account-creator.js
--- a/keyserver/src/creators/account-creator.js
+++ b/keyserver/src/creators/account-creator.js
@@ -3,7 +3,6 @@
import { getRustAPI } from 'rust-node-addon';
import bcrypt from 'twin-bcrypt';
-import bots from 'lib/facts/bots.js';
import genesis from 'lib/facts/genesis.js';
import { policyTypes } from 'lib/facts/policies.js';
import { validUsernameRegex } from 'lib/shared/account-utils.js';
@@ -30,11 +29,7 @@
persistFreshOlmSession,
createOlmSession,
} from './olm-session-creator.js';
-import {
- createThread,
- createPrivateThread,
- privateThreadDescription,
-} from './thread-creator.js';
+import { createThread } from './thread-creator.js';
import { dbQuery, SQL } from '../database/database.js';
import { deleteCookie } from '../deleters/cookie-deleters.js';
import { fetchThreadInfos } from '../fetchers/thread-fetchers.js';
@@ -55,16 +50,12 @@
thisKeyserverAdmin,
} from '../user/identity.js';
-const { commbot } = bots;
-
const ashoatMessages = [
'welcome to Comm!',
'as you inevitably discover bugs, have feature requests, or design ' +
'suggestions, feel free to message them to me in the app.',
];
-const privateMessages = [privateThreadDescription];
-
async function createAccount(
viewer: Viewer,
request: RegisterRequest,
@@ -195,19 +186,15 @@
{ forceAddMembers: true, silenceMessages: true, ignorePermissions: true },
);
- const [privateThreadResult, ashoatThreadResult] = await Promise.all([
- createPrivateThread(viewer),
- createThread(
- viewer,
- {
- type: threadTypes.GENESIS_PERSONAL,
- initialMemberIDs: [admin.id],
- },
- { forceAddMembers: true },
- ),
- ]);
+ const ashoatThreadResult = await createThread(
+ viewer,
+ {
+ type: threadTypes.GENESIS_PERSONAL,
+ initialMemberIDs: [admin.id],
+ },
+ { forceAddMembers: true },
+ );
const ashoatThreadID = ashoatThreadResult.newThreadID;
- const privateThreadID = privateThreadResult.newThreadID;
let messageTime = Date.now();
const ashoatMessageDatas = ashoatMessages.map(message => ({
@@ -217,21 +204,9 @@
time: messageTime++,
text: message,
}));
- const privateMessageDatas = privateMessages.map(message => ({
- type: messageTypes.TEXT,
- threadID: privateThreadID,
- creatorID: commbot.userID,
- time: messageTime++,
- text: message,
- }));
- const messageDatas = [...ashoatMessageDatas, ...privateMessageDatas];
- const messageInfos = await createMessages(viewer, messageDatas);
+ const ashoatMessageInfos = await createMessages(viewer, ashoatMessageDatas);
- return [
- ...ashoatThreadResult.newMessageInfos,
- ...privateThreadResult.newMessageInfos,
- ...messageInfos,
- ];
+ return [...ashoatThreadResult.newMessageInfos, ...ashoatMessageInfos];
}
async function createAndSendReservedUsernameMessage(
diff --git a/keyserver/src/creators/thread-creator.js b/keyserver/src/creators/thread-creator.js
--- a/keyserver/src/creators/thread-creator.js
+++ b/keyserver/src/creators/thread-creator.js
@@ -2,7 +2,6 @@
import invariant from 'invariant';
-import bots from 'lib/facts/bots.js';
import genesis from 'lib/facts/genesis.js';
import { getRolePermissionBlobs } from 'lib/permissions/thread-permissions.js';
import {
@@ -59,12 +58,6 @@
import { isAuthoritativeKeyserver } from '../user/identity.js';
import RelationshipChangeset from '../utils/relationship-changeset.js';
-const { commbot } = bots;
-
-const privateThreadDescription: string =
- 'This is your private chat, ' +
- 'where you can set reminders and jot notes in private!';
-
type CreateThreadOptions = Partial<{
+forceAddMembers: boolean,
+updatesForCurrentSession: UpdatesForCurrentSession,
@@ -518,18 +511,4 @@
};
}
-function createPrivateThread(viewer: Viewer): Promise<NewThreadResponse> {
- return createThread(
- viewer,
- {
- type: threadTypes.GENESIS_PRIVATE,
- description: privateThreadDescription,
- ghostMemberIDs: [commbot.userID],
- },
- {
- forceAddMembers: true,
- },
- );
-}
-
-export { createThread, createPrivateThread, privateThreadDescription };
+export { createThread };
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 20, 8:59 AM (21 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2543545
Default Alt Text
D13535.id44764.diff (4 KB)
Attached To
Mode
D13535: [keyserver] Stop creating GENESIS_PRIVATE thread on account creation
Attached
Detach File
Event Timeline
Log In to Comment