aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-01-03 17:25:47 +0100
committerChocobozzz <me@florianbigard.com>2018-01-03 17:35:00 +0100
commitcf117aaafc1e9ae1ab4c388fc5d2e5ba9349efee (patch)
treeab51ac2f2c7ec8dfc7fcde99565a4430874da599 /server/models
parent265ba139ebf56bbdc1c65f6ea4f367774c691fc0 (diff)
downloadPeerTube-cf117aaafc1e9ae1ab4c388fc5d2e5ba9349efee.tar.gz
PeerTube-cf117aaafc1e9ae1ab4c388fc5d2e5ba9349efee.tar.zst
PeerTube-cf117aaafc1e9ae1ab4c388fc5d2e5ba9349efee.zip
Add avatar in comments
Diffstat (limited to 'server/models')
-rw-r--r--server/models/video/video-comment.ts10
1 files changed, 6 insertions, 4 deletions
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
9import { CONSTRAINTS_FIELDS } from '../../initializers' 9import { CONSTRAINTS_FIELDS } from '../../initializers'
10import { AccountModel } from '../account/account' 10import { AccountModel } from '../account/account'
11import { ActorModel } from '../activitypub/actor' 11import { ActorModel } from '../activitypub/actor'
12import { AvatarModel } from '../avatar/avatar'
12import { ServerModel } from '../server/server' 13import { ServerModel } from '../server/server'
13import { getSort, throwIfNotValid } from '../utils' 14import { getSort, throwIfNotValid } from '../utils'
14import { VideoModel } from './video' 15import { VideoModel } from './video'
@@ -46,6 +47,10 @@ enum ScopeNames {
46 { 47 {
47 model: () => ServerModel, 48 model: () => ServerModel,
48 required: false 49 required: false
50 },
51 {
52 model: () => AvatarModel,
53 required: false
49 } 54 }
50 ] 55 ]
51 } 56 }
@@ -243,10 +248,7 @@ export class VideoCommentModel extends Model<VideoCommentModel> {
243 createdAt: this.createdAt, 248 createdAt: this.createdAt,
244 updatedAt: this.updatedAt, 249 updatedAt: this.updatedAt,
245 totalReplies: this.get('totalReplies') || 0, 250 totalReplies: this.get('totalReplies') || 0,
246 account: { 251 account: this.Account.toFormattedJSON()
247 name: this.Account.name,
248 host: this.Account.Actor.getHost()
249 }
250 } as VideoComment 252 } as VideoComment
251 } 253 }
252 254