aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/users
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/users')
-rw-r--r--client/src/app/shared/users/user.model.ts35
1 files changed, 14 insertions, 21 deletions
diff --git a/client/src/app/shared/users/user.model.ts b/client/src/app/shared/users/user.model.ts
index 581ea7859..2748001d0 100644
--- a/client/src/app/shared/users/user.model.ts
+++ b/client/src/app/shared/users/user.model.ts
@@ -7,7 +7,6 @@ import {
7 VideoChannel 7 VideoChannel
8} from '../../../../../shared' 8} from '../../../../../shared'
9import { NSFWPolicyType } from '../../../../../shared/models/videos/nsfw-policy.type' 9import { NSFWPolicyType } from '../../../../../shared/models/videos/nsfw-policy.type'
10import { Actor } from '@app/shared/actor/actor.model'
11import { Account } from '@app/shared/account/account.model' 10import { Account } from '@app/shared/account/account.model'
12import { Avatar } from '../../../../../shared/models/avatars/avatar.model' 11import { Avatar } from '../../../../../shared/models/avatars/avatar.model'
13 12
@@ -22,6 +21,9 @@ export type UserConstructorHash = {
22 createdAt?: Date, 21 createdAt?: Date,
23 account?: AccountServerModel, 22 account?: AccountServerModel,
24 videoChannels?: VideoChannel[] 23 videoChannels?: VideoChannel[]
24
25 blocked?: boolean
26 blockedReason?: string
25} 27}
26export class User implements UserServerModel { 28export class User implements UserServerModel {
27 id: number 29 id: number
@@ -35,35 +37,26 @@ export class User implements UserServerModel {
35 videoChannels: VideoChannel[] 37 videoChannels: VideoChannel[]
36 createdAt: Date 38 createdAt: Date
37 39
40 blocked: boolean
41 blockedReason?: string
42
38 constructor (hash: UserConstructorHash) { 43 constructor (hash: UserConstructorHash) {
39 this.id = hash.id 44 this.id = hash.id
40 this.username = hash.username 45 this.username = hash.username
41 this.email = hash.email 46 this.email = hash.email
42 this.role = hash.role 47 this.role = hash.role
43 48
49 this.videoChannels = hash.videoChannels
50 this.videoQuota = hash.videoQuota
51 this.nsfwPolicy = hash.nsfwPolicy
52 this.autoPlayVideo = hash.autoPlayVideo
53 this.createdAt = hash.createdAt
54 this.blocked = hash.blocked
55 this.blockedReason = hash.blockedReason
56
44 if (hash.account !== undefined) { 57 if (hash.account !== undefined) {
45 this.account = new Account(hash.account) 58 this.account = new Account(hash.account)
46 } 59 }
47
48 if (hash.videoChannels !== undefined) {
49 this.videoChannels = hash.videoChannels
50 }
51
52 if (hash.videoQuota !== undefined) {
53 this.videoQuota = hash.videoQuota
54 }
55
56 if (hash.nsfwPolicy !== undefined) {
57 this.nsfwPolicy = hash.nsfwPolicy
58 }
59
60 if (hash.autoPlayVideo !== undefined) {
61 this.autoPlayVideo = hash.autoPlayVideo
62 }
63
64 if (hash.createdAt !== undefined) {
65 this.createdAt = hash.createdAt
66 }
67 } 60 }
68 61
69 get accountAvatarUrl () { 62 get accountAvatarUrl () {