diff options
author | Chocobozzz <me@florianbigard.com> | 2020-07-01 16:05:30 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-07-10 14:02:41 +0200 |
commit | d95d15598847c7f020aa056e7e6e0c02d2bbf732 (patch) | |
tree | a8a593f1269688caf9e5f99559996f346290fec5 /client/src/app/shared/shared-main/users/user-notification.model.ts | |
parent | 72493e44e9b455a04c4f093ed6c6ffa300b98d8b (diff) | |
download | PeerTube-d95d15598847c7f020aa056e7e6e0c02d2bbf732.tar.gz PeerTube-d95d15598847c7f020aa056e7e6e0c02d2bbf732.tar.zst PeerTube-d95d15598847c7f020aa056e7e6e0c02d2bbf732.zip |
Use 3 tables to represent abuses
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.ts | 26 |
1 files changed, 19 insertions, 7 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 de25d3ab9..389a242fd 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 | |||
@@ -25,9 +25,20 @@ export class UserNotification implements UserNotificationServer { | |||
25 | video: VideoInfo | 25 | video: VideoInfo |
26 | } | 26 | } |
27 | 27 | ||
28 | videoAbuse?: { | 28 | abuse?: { |
29 | id: number | 29 | id: number |
30 | video: VideoInfo | 30 | |
31 | video?: VideoInfo | ||
32 | |||
33 | comment?: { | ||
34 | threadId: number | ||
35 | |||
36 | video: { | ||
37 | uuid: string | ||
38 | } | ||
39 | } | ||
40 | |||
41 | account?: ActorInfo | ||
31 | } | 42 | } |
32 | 43 | ||
33 | videoBlacklist?: { | 44 | videoBlacklist?: { |
@@ -55,7 +66,7 @@ export class UserNotification implements UserNotificationServer { | |||
55 | // Additional fields | 66 | // Additional fields |
56 | videoUrl?: string | 67 | videoUrl?: string |
57 | commentUrl?: any[] | 68 | commentUrl?: any[] |
58 | videoAbuseUrl?: string | 69 | abuseUrl?: string |
59 | videoAutoBlacklistUrl?: string | 70 | videoAutoBlacklistUrl?: string |
60 | accountUrl?: string | 71 | accountUrl?: string |
61 | videoImportIdentifier?: string | 72 | videoImportIdentifier?: string |
@@ -78,7 +89,7 @@ export class UserNotification implements UserNotificationServer { | |||
78 | this.comment = hash.comment | 89 | this.comment = hash.comment |
79 | if (this.comment) this.setAvatarUrl(this.comment.account) | 90 | if (this.comment) this.setAvatarUrl(this.comment.account) |
80 | 91 | ||
81 | this.videoAbuse = hash.videoAbuse | 92 | this.abuse = hash.abuse |
82 | 93 | ||
83 | this.videoBlacklist = hash.videoBlacklist | 94 | this.videoBlacklist = hash.videoBlacklist |
84 | 95 | ||
@@ -108,8 +119,9 @@ export class UserNotification implements UserNotificationServer { | |||
108 | break | 119 | break |
109 | 120 | ||
110 | case UserNotificationType.NEW_VIDEO_ABUSE_FOR_MODERATORS: | 121 | case UserNotificationType.NEW_VIDEO_ABUSE_FOR_MODERATORS: |
111 | this.videoAbuseUrl = '/admin/moderation/video-abuses/list' | 122 | this.abuseUrl = '/admin/moderation/abuses/list' |
112 | this.videoUrl = this.buildVideoUrl(this.videoAbuse.video) | 123 | |
124 | if (this.abuse.video) this.videoUrl = this.buildVideoUrl(this.abuse.video) | ||
113 | break | 125 | break |
114 | 126 | ||
115 | case UserNotificationType.VIDEO_AUTO_BLACKLIST_FOR_MODERATORS: | 127 | case UserNotificationType.VIDEO_AUTO_BLACKLIST_FOR_MODERATORS: |
@@ -178,7 +190,7 @@ export class UserNotification implements UserNotificationServer { | |||
178 | return videoImport.targetUrl || videoImport.magnetUri || videoImport.torrentName | 190 | return videoImport.targetUrl || videoImport.magnetUri || videoImport.torrentName |
179 | } | 191 | } |
180 | 192 | ||
181 | private setAvatarUrl (actor: { avatarUrl?: string, avatar?: Avatar }) { | 193 | private setAvatarUrl (actor: { avatarUrl?: string, avatar?: { url?: string, path: string } }) { |
182 | actor.avatarUrl = Actor.GET_ACTOR_AVATAR_URL(actor) | 194 | actor.avatarUrl = Actor.GET_ACTOR_AVATAR_URL(actor) |
183 | } | 195 | } |
184 | } | 196 | } |