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.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/lib/user.ts b/server/lib/user.ts
index a2163abb1..91a682a7e 100644
--- a/server/lib/user.ts
+++ b/server/lib/user.ts
@@ -44,11 +44,11 @@ async function createUserAccountAndChannelAndPlaylist (parameters: {
44 displayName: userDisplayName, 44 displayName: userDisplayName,
45 userId: userCreated.id, 45 userId: userCreated.id,
46 applicationId: null, 46 applicationId: null,
47 t: t 47 t
48 }) 48 })
49 userCreated.Account = accountCreated 49 userCreated.Account = accountCreated
50 50
51 const channelAttributes = await buildChannelAttributes(userCreated, channelNames) 51 const channelAttributes = await buildChannelAttributes(userCreated, t, channelNames)
52 const videoChannel = await createLocalVideoChannel(channelAttributes, accountCreated, t) 52 const videoChannel = await createLocalVideoChannel(channelAttributes, accountCreated, t)
53 53
54 const videoPlaylist = await createWatchLaterPlaylist(accountCreated, t) 54 const videoPlaylist = await createWatchLaterPlaylist(accountCreated, t)
@@ -203,13 +203,13 @@ function createDefaultUserNotificationSettings (user: MUserId, t: Transaction |
203 return UserNotificationSettingModel.create(values, { transaction: t }) 203 return UserNotificationSettingModel.create(values, { transaction: t })
204} 204}
205 205
206async function buildChannelAttributes (user: MUser, channelNames?: ChannelNames) { 206async function buildChannelAttributes (user: MUser, transaction?: Transaction, channelNames?: ChannelNames) {
207 if (channelNames) return channelNames 207 if (channelNames) return channelNames
208 208
209 let channelName = user.username + '_channel' 209 let channelName = user.username + '_channel'
210 210
211 // Conflict, generate uuid instead 211 // Conflict, generate uuid instead
212 const actor = await ActorModel.loadLocalByName(channelName) 212 const actor = await ActorModel.loadLocalByName(channelName, transaction)
213 if (actor) channelName = uuidv4() 213 if (actor) channelName = uuidv4()
214 214
215 const videoChannelDisplayName = `Main ${user.username} channel` 215 const videoChannelDisplayName = `Main ${user.username} channel`