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 @@ -6,6 +6,7 @@ import ashoat from 'lib/facts/ashoat'; import bots from 'lib/facts/bots'; import genesis from 'lib/facts/genesis'; +import { policyTypes } from 'lib/facts/policies.js'; import { validUsernameRegex, oldValidUsernameRegex, @@ -33,6 +34,7 @@ import { createScriptViewer } from '../session/scripts'; import type { Viewer } from '../session/viewer'; import { updateThread } from '../updaters/thread-updaters'; +import { viewerAcknowledgmentUpdater } from '../updaters/viewer-acknowledgment-updater.js'; import createIDs from './id-creator'; import createMessages from './message-creator'; import { @@ -108,18 +110,22 @@ dbQuery(newUserQuery), ]); viewer.setNewCookie(userViewerData); + if (calendarQuery) { await setNewSession(viewer, calendarQuery, 0); } - await updateThread( - createScriptViewer(ashoat.id), - { - threadID: genesis.id, - changes: { newMemberIDs: [id] }, - }, - { forceAddMembers: true, silenceMessages: true, ignorePermissions: true }, - ); + await Promise.all([ + updateThread( + createScriptViewer(ashoat.id), + { + threadID: genesis.id, + changes: { newMemberIDs: [id] }, + }, + { forceAddMembers: true, silenceMessages: true, ignorePermissions: true }, + ), + viewerAcknowledgmentUpdater(viewer, policyTypes.tosAndPrivacyPolicy), + ]); const [privateThreadResult, ashoatThreadResult] = await Promise.all([ createPrivateThread(viewer, request.username),