aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-main/users/user-notification.model.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/shared-main/users/user-notification.model.ts')
-rw-r--r--client/src/app/shared/shared-main/users/user-notification.model.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/client/src/app/shared/shared-main/users/user-notification.model.ts b/client/src/app/shared/shared-main/users/user-notification.model.ts
index a137f8c62..61b48a806 100644
--- a/client/src/app/shared/shared-main/users/user-notification.model.ts
+++ b/client/src/app/shared/shared-main/users/user-notification.model.ts
@@ -34,7 +34,9 @@ export class UserNotification implements UserNotificationServer {
34 threadId: number 34 threadId: number
35 35
36 video: { 36 video: {
37 id: number
37 uuid: string 38 uuid: string
39 name: string
38 } 40 }
39 } 41 }
40 42
@@ -115,13 +117,15 @@ export class UserNotification implements UserNotificationServer {
115 case UserNotificationType.COMMENT_MENTION: 117 case UserNotificationType.COMMENT_MENTION:
116 if (!this.comment) break 118 if (!this.comment) break
117 this.accountUrl = this.buildAccountUrl(this.comment.account) 119 this.accountUrl = this.buildAccountUrl(this.comment.account)
118 this.commentUrl = [ this.buildVideoUrl(this.comment.video), { threadId: this.comment.threadId } ] 120 this.commentUrl = this.buildCommentUrl(this.comment)
119 break 121 break
120 122
121 case UserNotificationType.NEW_ABUSE_FOR_MODERATORS: 123 case UserNotificationType.NEW_ABUSE_FOR_MODERATORS:
122 this.abuseUrl = '/admin/moderation/abuses/list' 124 this.abuseUrl = '/admin/moderation/abuses/list'
123 125
124 if (this.abuse.video) this.videoUrl = this.buildVideoUrl(this.abuse.video) 126 if (this.abuse.video) this.videoUrl = this.buildVideoUrl(this.abuse.video)
127 else if (this.abuse.comment) this.commentUrl = this.buildCommentUrl(this.abuse.comment)
128 else if (this.abuse.account) this.accountUrl = this.buildAccountUrl(this.abuse.account)
125 break 129 break
126 130
127 case UserNotificationType.VIDEO_AUTO_BLACKLIST_FOR_MODERATORS: 131 case UserNotificationType.VIDEO_AUTO_BLACKLIST_FOR_MODERATORS:
@@ -190,6 +194,10 @@ export class UserNotification implements UserNotificationServer {
190 return videoImport.targetUrl || videoImport.magnetUri || videoImport.torrentName 194 return videoImport.targetUrl || videoImport.magnetUri || videoImport.torrentName
191 } 195 }
192 196
197 private buildCommentUrl (comment: { video: { uuid: string }, threadId: number }) {
198 return [ this.buildVideoUrl(comment.video), { threadId: comment.threadId } ]
199 }
200
193 private setAvatarUrl (actor: { avatarUrl?: string, avatar?: { url?: string, path: string } }) { 201 private setAvatarUrl (actor: { avatarUrl?: string, avatar?: { url?: string, path: string } }) {
194 actor.avatarUrl = Actor.GET_ACTOR_AVATAR_URL(actor) 202 actor.avatarUrl = Actor.GET_ACTOR_AVATAR_URL(actor)
195 } 203 }