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