]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/videos/+video-watch/comment/video-comment.model.ts
Send comment to followers and parents
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / +video-watch / comment / video-comment.model.ts
1 import { Account } from '../../../../../../shared/models/actors'
2 import { VideoComment as VideoCommentServerModel } from '../../../../../../shared/models/videos/video-comment.model'
3
4 export class VideoComment implements VideoCommentServerModel {
5 id: number
6 url: string
7 text: string
8 threadId: number
9 inReplyToCommentId: number
10 videoId: number
11 createdAt: Date | string
12 updatedAt: Date | string
13 account: Account
14 totalReplies: number
15
16 by: string
17
18 private static createByString (account: string, serverHost: string) {
19 return account + '@' + serverHost
20 }
21
22 constructor (hash: VideoCommentServerModel) {
23 this.id = hash.id
24 this.url = hash.url
25 this.text = hash.text
26 this.threadId = hash.threadId
27 this.inReplyToCommentId = hash.inReplyToCommentId
28 this.videoId = hash.videoId
29 this.createdAt = new Date(hash.createdAt.toString())
30 this.updatedAt = new Date(hash.updatedAt.toString())
31 this.account = hash.account
32 this.totalReplies = hash.totalReplies
33
34 this.by = VideoComment.createByString(this.account.name, this.account.host)
35 }
36 }