From e4f97babf701481b55cc10fb3448feab5f97c867 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 9 Nov 2017 17:51:58 +0100 Subject: Begin activitypub --- server/lib/user.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'server/lib/user.ts') diff --git a/server/lib/user.ts b/server/lib/user.ts index a92f4777b..57c653e55 100644 --- a/server/lib/user.ts +++ b/server/lib/user.ts @@ -1,9 +1,9 @@ import { database as db } from '../initializers' import { UserInstance } from '../models' -import { addVideoAuthorToFriends } from './friends' +import { addVideoAccountToFriends } from './friends' import { createVideoChannel } from './video-channel' -async function createUserAuthorAndChannel (user: UserInstance, validateUser = true) { +async function createUserAccountAndChannel (user: UserInstance, validateUser = true) { const res = await db.sequelize.transaction(async t => { const userOptions = { transaction: t, @@ -11,25 +11,25 @@ async function createUserAuthorAndChannel (user: UserInstance, validateUser = tr } const userCreated = await user.save(userOptions) - const authorInstance = db.Author.build({ + const accountInstance = db.Account.build({ name: userCreated.username, podId: null, // It is our pod userId: userCreated.id }) - const authorCreated = await authorInstance.save({ transaction: t }) + const accountCreated = await accountInstance.save({ transaction: t }) - const remoteVideoAuthor = authorCreated.toAddRemoteJSON() + const remoteVideoAccount = accountCreated.toAddRemoteJSON() // Now we'll add the video channel's meta data to our friends - const author = await addVideoAuthorToFriends(remoteVideoAuthor, t) + const account = await addVideoAccountToFriends(remoteVideoAccount, t) const videoChannelInfo = { name: `Default ${userCreated.username} channel` } - const videoChannel = await createVideoChannel(videoChannelInfo, authorCreated, t) + const videoChannel = await createVideoChannel(videoChannelInfo, accountCreated, t) - return { author, videoChannel } + return { account, videoChannel } }) return res @@ -38,5 +38,5 @@ async function createUserAuthorAndChannel (user: UserInstance, validateUser = tr // --------------------------------------------------------------------------- export { - createUserAuthorAndChannel + createUserAccountAndChannel } -- cgit v1.2.3