aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/user.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/user.ts')
-rw-r--r--server/lib/user.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/server/lib/user.ts b/server/lib/user.ts
index 51050de9b..ac5f55260 100644
--- a/server/lib/user.ts
+++ b/server/lib/user.ts
@@ -6,6 +6,7 @@ import { UserModel } from '../models/account/user'
6import { buildActorInstance, getAccountActivityPubUrl, setAsyncActorKeys } from './activitypub' 6import { buildActorInstance, getAccountActivityPubUrl, setAsyncActorKeys } from './activitypub'
7import { createVideoChannel } from './video-channel' 7import { createVideoChannel } from './video-channel'
8import { VideoChannelModel } from '../models/video/video-channel' 8import { VideoChannelModel } from '../models/video/video-channel'
9import { FilteredModelAttributes } from 'sequelize-typescript/lib/models/Model'
9 10
10async function createUserAccountAndChannel (userToCreate: UserModel, validateUser = true) { 11async function createUserAccountAndChannel (userToCreate: UserModel, validateUser = true) {
11 const { user, account, videoChannel } = await sequelizeTypescript.transaction(async t => { 12 const { user, account, videoChannel } = await sequelizeTypescript.transaction(async t => {
@@ -34,9 +35,9 @@ async function createUserAccountAndChannel (userToCreate: UserModel, validateUse
34 35
35async function createLocalAccountWithoutKeys ( 36async function createLocalAccountWithoutKeys (
36 name: string, 37 name: string,
37 userId: number, 38 userId: number | null,
38 applicationId: number, 39 applicationId: number | null,
39 t: Sequelize.Transaction, 40 t: Sequelize.Transaction | undefined,
40 type: ActivityPubActorType= 'Person' 41 type: ActivityPubActorType= 'Person'
41) { 42) {
42 const url = getAccountActivityPubUrl(name) 43 const url = getAccountActivityPubUrl(name)
@@ -49,7 +50,7 @@ async function createLocalAccountWithoutKeys (
49 userId, 50 userId,
50 applicationId, 51 applicationId,
51 actorId: actorInstanceCreated.id 52 actorId: actorInstanceCreated.id
52 }) 53 } as FilteredModelAttributes<AccountModel>)
53 54
54 const accountInstanceCreated = await accountInstance.save({ transaction: t }) 55 const accountInstanceCreated = await accountInstance.save({ transaction: t })
55 accountInstanceCreated.Actor = actorInstanceCreated 56 accountInstanceCreated.Actor = actorInstanceCreated