From cf117aaafc1e9ae1ab4c388fc5d2e5ba9349efee Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 3 Jan 2018 17:25:47 +0100 Subject: Add avatar in comments --- server/models/video/video-comment.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'server/models/video/video-comment.ts') diff --git a/server/models/video/video-comment.ts b/server/models/video/video-comment.ts index 63675c20b..d2d8945c3 100644 --- a/server/models/video/video-comment.ts +++ b/server/models/video/video-comment.ts @@ -9,6 +9,7 @@ import { isActivityPubUrlValid } from '../../helpers/custom-validators/activityp import { CONSTRAINTS_FIELDS } from '../../initializers' import { AccountModel } from '../account/account' import { ActorModel } from '../activitypub/actor' +import { AvatarModel } from '../avatar/avatar' import { ServerModel } from '../server/server' import { getSort, throwIfNotValid } from '../utils' import { VideoModel } from './video' @@ -46,6 +47,10 @@ enum ScopeNames { { model: () => ServerModel, required: false + }, + { + model: () => AvatarModel, + required: false } ] } @@ -243,10 +248,7 @@ export class VideoCommentModel extends Model { createdAt: this.createdAt, updatedAt: this.updatedAt, totalReplies: this.get('totalReplies') || 0, - account: { - name: this.Account.name, - host: this.Account.Actor.getHost() - } + account: this.Account.toFormattedJSON() } as VideoComment } -- cgit v1.2.3