diff options
author | Chocobozzz <me@florianbigard.com> | 2018-01-18 10:53:54 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-01-18 15:42:20 +0100 |
commit | f05a1c30c15d2ae35c11e241ca039a72eeb7d6ad (patch) | |
tree | 6d90c0de5dd3ad506e738d447e4f396951ed5624 /server/lib/user.ts | |
parent | 1174a8479ab9ee47b3305d668fe757435057a298 (diff) | |
download | PeerTube-f05a1c30c15d2ae35c11e241ca039a72eeb7d6ad.tar.gz PeerTube-f05a1c30c15d2ae35c11e241ca039a72eeb7d6ad.tar.zst PeerTube-f05a1c30c15d2ae35c11e241ca039a72eeb7d6ad.zip |
Don't show videos of remote instance after unfollow
Diffstat (limited to 'server/lib/user.ts')
-rw-r--r-- | server/lib/user.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/server/lib/user.ts b/server/lib/user.ts index ec1466c6f..aa029cce7 100644 --- a/server/lib/user.ts +++ b/server/lib/user.ts | |||
@@ -6,15 +6,15 @@ import { UserModel } from '../models/account/user' | |||
6 | import { buildActorInstance, getAccountActivityPubUrl, setAsyncActorKeys } from './activitypub' | 6 | import { buildActorInstance, getAccountActivityPubUrl, setAsyncActorKeys } from './activitypub' |
7 | import { createVideoChannel } from './video-channel' | 7 | import { createVideoChannel } from './video-channel' |
8 | 8 | ||
9 | async function createUserAccountAndChannel (user: UserModel, validateUser = true) { | 9 | async function createUserAccountAndChannel (userToCreate: UserModel, validateUser = true) { |
10 | const { account, videoChannel } = await sequelizeTypescript.transaction(async t => { | 10 | const { user, account, videoChannel } = await sequelizeTypescript.transaction(async t => { |
11 | const userOptions = { | 11 | const userOptions = { |
12 | transaction: t, | 12 | transaction: t, |
13 | validate: validateUser | 13 | validate: validateUser |
14 | } | 14 | } |
15 | 15 | ||
16 | const userCreated = await user.save(userOptions) | 16 | const userCreated = await userToCreate.save(userOptions) |
17 | const accountCreated = await createLocalAccountWithoutKeys(user.username, user.id, null, t) | 17 | const accountCreated = await createLocalAccountWithoutKeys(userToCreate.username, userToCreate.id, null, t) |
18 | 18 | ||
19 | const videoChannelName = `Default ${userCreated.username} channel` | 19 | const videoChannelName = `Default ${userCreated.username} channel` |
20 | const videoChannelInfo = { | 20 | const videoChannelInfo = { |
@@ -22,13 +22,13 @@ async function createUserAccountAndChannel (user: UserModel, validateUser = true | |||
22 | } | 22 | } |
23 | const videoChannel = await createVideoChannel(videoChannelInfo, accountCreated, t) | 23 | const videoChannel = await createVideoChannel(videoChannelInfo, accountCreated, t) |
24 | 24 | ||
25 | return { account: accountCreated, videoChannel } | 25 | return { user: userCreated, account: accountCreated, videoChannel } |
26 | }) | 26 | }) |
27 | 27 | ||
28 | account.Actor = await setAsyncActorKeys(account.Actor) | 28 | account.Actor = await setAsyncActorKeys(account.Actor) |
29 | videoChannel.Actor = await setAsyncActorKeys(videoChannel.Actor) | 29 | videoChannel.Actor = await setAsyncActorKeys(videoChannel.Actor) |
30 | 30 | ||
31 | return { account, videoChannel } | 31 | return { user, account, videoChannel } |
32 | } | 32 | } |
33 | 33 | ||
34 | async function createLocalAccountWithoutKeys ( | 34 | async function createLocalAccountWithoutKeys ( |