aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-12-18 11:32:37 +0100
committerChocobozzz <me@florianbigard.com>2018-12-18 11:35:51 +0100
commit276d96529529621d5f70473990095495f2743c29 (patch)
tree9fc62fc44dce05302215b10da13789ce89c9ee04 /client/src/app/shared
parent80bfd33c0bf910e2cfdd3270b14ba9eddd90e2e8 (diff)
downloadPeerTube-276d96529529621d5f70473990095495f2743c29.tar.gz
PeerTube-276d96529529621d5f70473990095495f2743c29.tar.zst
PeerTube-276d96529529621d5f70473990095495f2743c29.zip
Add ability to disable and clear history
Diffstat (limited to 'client/src/app/shared')
-rw-r--r--client/src/app/shared/users/user.model.ts33
1 files changed, 6 insertions, 27 deletions
diff --git a/client/src/app/shared/users/user.model.ts b/client/src/app/shared/users/user.model.ts
index 9819829fd..3663a7b61 100644
--- a/client/src/app/shared/users/user.model.ts
+++ b/client/src/app/shared/users/user.model.ts
@@ -1,33 +1,8 @@
1import { 1import { hasUserRight, User as UserServerModel, UserRight, UserRole, VideoChannel } from '../../../../../shared'
2 Account as AccountServerModel,
3 hasUserRight,
4 User as UserServerModel,
5 UserRight,
6 UserRole,
7 VideoChannel
8} from '../../../../../shared'
9import { NSFWPolicyType } from '../../../../../shared/models/videos/nsfw-policy.type' 2import { NSFWPolicyType } from '../../../../../shared/models/videos/nsfw-policy.type'
10import { Account } from '@app/shared/account/account.model' 3import { Account } from '@app/shared/account/account.model'
11import { Avatar } from '../../../../../shared/models/avatars/avatar.model' 4import { Avatar } from '../../../../../shared/models/avatars/avatar.model'
12 5
13export type UserConstructorHash = {
14 id: number,
15 username: string,
16 email: string,
17 role: UserRole,
18 emailVerified?: boolean,
19 videoQuota?: number,
20 videoQuotaDaily?: number,
21 nsfwPolicy?: NSFWPolicyType,
22 webTorrentEnabled?: boolean,
23 autoPlayVideo?: boolean,
24 createdAt?: Date,
25 account?: AccountServerModel,
26 videoChannels?: VideoChannel[]
27
28 blocked?: boolean
29 blockedReason?: string
30}
31export class User implements UserServerModel { 6export class User implements UserServerModel {
32 id: number 7 id: number
33 username: string 8 username: string
@@ -35,8 +10,11 @@ export class User implements UserServerModel {
35 emailVerified: boolean 10 emailVerified: boolean
36 role: UserRole 11 role: UserRole
37 nsfwPolicy: NSFWPolicyType 12 nsfwPolicy: NSFWPolicyType
13
38 webTorrentEnabled: boolean 14 webTorrentEnabled: boolean
39 autoPlayVideo: boolean 15 autoPlayVideo: boolean
16 videosHistoryEnabled: boolean
17
40 videoQuota: number 18 videoQuota: number
41 videoQuotaDaily: number 19 videoQuotaDaily: number
42 account: Account 20 account: Account
@@ -46,7 +24,7 @@ export class User implements UserServerModel {
46 blocked: boolean 24 blocked: boolean
47 blockedReason?: string 25 blockedReason?: string
48 26
49 constructor (hash: UserConstructorHash) { 27 constructor (hash: Partial<UserServerModel>) {
50 this.id = hash.id 28 this.id = hash.id
51 this.username = hash.username 29 this.username = hash.username
52 this.email = hash.email 30 this.email = hash.email
@@ -57,6 +35,7 @@ export class User implements UserServerModel {
57 this.videoQuotaDaily = hash.videoQuotaDaily 35 this.videoQuotaDaily = hash.videoQuotaDaily
58 this.nsfwPolicy = hash.nsfwPolicy 36 this.nsfwPolicy = hash.nsfwPolicy
59 this.webTorrentEnabled = hash.webTorrentEnabled 37 this.webTorrentEnabled = hash.webTorrentEnabled
38 this.videosHistoryEnabled = hash.videosHistoryEnabled
60 this.autoPlayVideo = hash.autoPlayVideo 39 this.autoPlayVideo = hash.autoPlayVideo
61 this.createdAt = hash.createdAt 40 this.createdAt = hash.createdAt
62 this.blocked = hash.blocked 41 this.blocked = hash.blocked