diff options
Diffstat (limited to 'client/src/app/shared/users/user-notification.model.ts')
-rw-r--r-- | client/src/app/shared/users/user-notification.model.ts | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/client/src/app/shared/users/user-notification.model.ts b/client/src/app/shared/users/user-notification.model.ts index 5ff816fb8..c5996a8a1 100644 --- a/client/src/app/shared/users/user-notification.model.ts +++ b/client/src/app/shared/users/user-notification.model.ts | |||
@@ -1,4 +1,5 @@ | |||
1 | import { UserNotification as UserNotificationServer, UserNotificationType, VideoInfo } from '../../../../../shared' | 1 | import { UserNotification as UserNotificationServer, UserNotificationType, VideoInfo, ActorInfo } from '../../../../../shared' |
2 | import { Actor } from '@app/shared/actor/actor.model' | ||
2 | 3 | ||
3 | export class UserNotification implements UserNotificationServer { | 4 | export class UserNotification implements UserNotificationServer { |
4 | id: number | 5 | id: number |
@@ -6,10 +7,7 @@ export class UserNotification implements UserNotificationServer { | |||
6 | read: boolean | 7 | read: boolean |
7 | 8 | ||
8 | video?: VideoInfo & { | 9 | video?: VideoInfo & { |
9 | channel: { | 10 | channel: ActorInfo & { avatarUrl?: string } |
10 | id: number | ||
11 | displayName: string | ||
12 | } | ||
13 | } | 11 | } |
14 | 12 | ||
15 | videoImport?: { | 13 | videoImport?: { |
@@ -23,10 +21,7 @@ export class UserNotification implements UserNotificationServer { | |||
23 | comment?: { | 21 | comment?: { |
24 | id: number | 22 | id: number |
25 | threadId: number | 23 | threadId: number |
26 | account: { | 24 | account: ActorInfo & { avatarUrl?: string } |
27 | id: number | ||
28 | displayName: string | ||
29 | } | ||
30 | video: VideoInfo | 25 | video: VideoInfo |
31 | } | 26 | } |
32 | 27 | ||
@@ -40,18 +35,11 @@ export class UserNotification implements UserNotificationServer { | |||
40 | video: VideoInfo | 35 | video: VideoInfo |
41 | } | 36 | } |
42 | 37 | ||
43 | account?: { | 38 | account?: ActorInfo & { avatarUrl?: string } |
44 | id: number | ||
45 | displayName: string | ||
46 | name: string | ||
47 | } | ||
48 | 39 | ||
49 | actorFollow?: { | 40 | actorFollow?: { |
50 | id: number | 41 | id: number |
51 | follower: { | 42 | follower: ActorInfo & { avatarUrl?: string } |
52 | name: string | ||
53 | displayName: string | ||
54 | } | ||
55 | following: { | 43 | following: { |
56 | type: 'account' | 'channel' | 44 | type: 'account' | 'channel' |
57 | name: string | 45 | name: string |
@@ -76,12 +64,22 @@ export class UserNotification implements UserNotificationServer { | |||
76 | this.read = hash.read | 64 | this.read = hash.read |
77 | 65 | ||
78 | this.video = hash.video | 66 | this.video = hash.video |
67 | if (this.video) this.setAvatarUrl(this.video.channel) | ||
68 | |||
79 | this.videoImport = hash.videoImport | 69 | this.videoImport = hash.videoImport |
70 | |||
80 | this.comment = hash.comment | 71 | this.comment = hash.comment |
72 | if (this.comment) this.setAvatarUrl(this.comment.account) | ||
73 | |||
81 | this.videoAbuse = hash.videoAbuse | 74 | this.videoAbuse = hash.videoAbuse |
75 | |||
82 | this.videoBlacklist = hash.videoBlacklist | 76 | this.videoBlacklist = hash.videoBlacklist |
77 | |||
83 | this.account = hash.account | 78 | this.account = hash.account |
79 | if (this.account) this.setAvatarUrl(this.account) | ||
80 | |||
84 | this.actorFollow = hash.actorFollow | 81 | this.actorFollow = hash.actorFollow |
82 | if (this.actorFollow) this.setAvatarUrl(this.actorFollow.follower) | ||
85 | 83 | ||
86 | this.createdAt = hash.createdAt | 84 | this.createdAt = hash.createdAt |
87 | this.updatedAt = hash.updatedAt | 85 | this.updatedAt = hash.updatedAt |
@@ -150,4 +148,7 @@ export class UserNotification implements UserNotificationServer { | |||
150 | return videoImport.targetUrl || videoImport.magnetUri || videoImport.torrentName | 148 | return videoImport.targetUrl || videoImport.magnetUri || videoImport.torrentName |
151 | } | 149 | } |
152 | 150 | ||
151 | private setAvatarUrl (actor: { avatarUrl?: string, avatar?: { path: string } }) { | ||
152 | actor.avatarUrl = Actor.GET_ACTOR_AVATAR_URL(actor) | ||
153 | } | ||
153 | } | 154 | } |