X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fuser.ts;h=e1892f22c89646b08a68f32ddb6b52985d7f1894;hb=a2eba50b8eee6d13b46425af05ef24025a173801;hp=7d6497302fe3d5974df05b6870a636d6b920867c;hpb=97969c4edf51b37eee691adba43368bb0fbb729b;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/user.ts b/server/lib/user.ts index 7d6497302..e1892f22c 100644 --- a/server/lib/user.ts +++ b/server/lib/user.ts @@ -10,8 +10,8 @@ import { UserNotificationSettingModel } from '../models/account/user-notificatio import { ActorModel } from '../models/activitypub/actor' import { MAccountDefault, MActorDefault, MChannelActor } from '../types/models' import { MUser, MUserDefault, MUserId } from '../types/models/user' -import { buildActorInstance, setAsyncActorKeys } from './activitypub/actor' -import { getAccountActivityPubUrl } from './activitypub/url' +import { buildActorInstance, generateAndSaveActorKeys } from './activitypub/actor' +import { getLocalAccountActivityPubUrl } from './activitypub/url' import { Emailer } from './emailer' import { LiveManager } from './live-manager' import { Redis } from './redis' @@ -55,8 +55,8 @@ async function createUserAccountAndChannelAndPlaylist (parameters: { }) const [ accountActorWithKeys, channelActorWithKeys ] = await Promise.all([ - setAsyncActorKeys(account.Actor), - setAsyncActorKeys(videoChannel.Actor) + generateAndSaveActorKeys(account.Actor), + generateAndSaveActorKeys(videoChannel.Actor) ]) account.Actor = accountActorWithKeys @@ -74,7 +74,7 @@ async function createLocalAccountWithoutKeys (parameters: { type?: ActivityPubActorType }) { const { name, displayName, userId, applicationId, t, type = 'Person' } = parameters - const url = getAccountActivityPubUrl(name) + const url = getLocalAccountActivityPubUrl(name) const actorInstance = buildActorInstance(type, url, name) const actorInstanceCreated: MActorDefault = await actorInstance.save({ transaction: t }) @@ -101,7 +101,7 @@ async function createApplicationActor (applicationId: number) { type: 'Application' }) - accountCreated.Actor = await setAsyncActorKeys(accountCreated.Actor) + accountCreated.Actor = await generateAndSaveActorKeys(accountCreated.Actor) return accountCreated }