From c48e82b5e0478434de30626d14594a97f2402e7c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 11 Sep 2018 16:27:07 +0200 Subject: Basic video redundancy implementation --- server/models/activitypub/actor.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'server/models/activitypub/actor.ts') diff --git a/server/models/activitypub/actor.ts b/server/models/activitypub/actor.ts index 119d0c1da..ef8dd9f7c 100644 --- a/server/models/activitypub/actor.ts +++ b/server/models/activitypub/actor.ts @@ -76,7 +76,13 @@ export const unusedActorAttributesForAPI = [ }, { model: () => VideoChannelModel.unscoped(), - required: false + required: false, + include: [ + { + model: () => AccountModel, + required: true + } + ] }, { model: () => ServerModel, @@ -337,6 +343,7 @@ export class ActorModel extends Model { uuid: this.uuid, name: this.preferredUsername, host: this.getHost(), + hostRedundancyAllowed: this.getRedundancyAllowed(), followingCount: this.followingCount, followersCount: this.followersCount, avatar, @@ -440,6 +447,10 @@ export class ActorModel extends Model { return this.Server ? this.Server.host : CONFIG.WEBSERVER.HOST } + getRedundancyAllowed () { + return this.Server ? this.Server.redundancyAllowed : false + } + getAvatarUrl () { if (!this.avatarId) return undefined -- cgit v1.2.3