aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-video-comment/video-comment.model.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/shared-video-comment/video-comment.model.ts')
-rw-r--r--client/src/app/shared/shared-video-comment/video-comment.model.ts52
1 files changed, 51 insertions, 1 deletions
diff --git a/client/src/app/shared/shared-video-comment/video-comment.model.ts b/client/src/app/shared/shared-video-comment/video-comment.model.ts
index e85443196..1589091e5 100644
--- a/client/src/app/shared/shared-video-comment/video-comment.model.ts
+++ b/client/src/app/shared/shared-video-comment/video-comment.model.ts
@@ -1,6 +1,6 @@
1import { getAbsoluteAPIUrl } from '@app/helpers' 1import { getAbsoluteAPIUrl } from '@app/helpers'
2import { Actor } from '@app/shared/shared-main' 2import { Actor } from '@app/shared/shared-main'
3import { Account as AccountInterface, VideoComment as VideoCommentServerModel } from '@shared/models' 3import { Account as AccountInterface, VideoComment as VideoCommentServerModel, VideoCommentAdmin as VideoCommentAdminServerModel } from '@shared/models'
4 4
5export class VideoComment implements VideoCommentServerModel { 5export class VideoComment implements VideoCommentServerModel {
6 id: number 6 id: number
@@ -46,3 +46,53 @@ export class VideoComment implements VideoCommentServerModel {
46 } 46 }
47 } 47 }
48} 48}
49
50export class VideoCommentAdmin implements VideoCommentAdminServerModel {
51 id: number
52 url: string
53 text: string
54 textHtml: string
55
56 threadId: number
57 inReplyToCommentId: number
58
59 createdAt: Date | string
60 updatedAt: Date | string
61
62 account: AccountInterface
63
64 video: {
65 id: number
66 uuid: string
67 name: string
68 }
69
70 by: string
71 accountAvatarUrl: string
72
73 constructor (hash: VideoCommentAdminServerModel, textHtml: string) {
74 this.id = hash.id
75 this.url = hash.url
76 this.text = hash.text
77 this.textHtml = textHtml
78
79 this.threadId = hash.threadId
80 this.inReplyToCommentId = hash.inReplyToCommentId
81
82 this.createdAt = new Date(hash.createdAt.toString())
83 this.updatedAt = new Date(hash.updatedAt.toString())
84
85 this.video = {
86 id: hash.video.id,
87 uuid: hash.video.uuid,
88 name: hash.video.name
89 }
90
91 this.account = hash.account
92
93 if (this.account) {
94 this.by = Actor.CREATE_BY_STRING(this.account.name, this.account.host)
95 this.accountAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.account)
96 }
97 }
98}