X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=client%2Fsrc%2Fapp%2Fshared%2Fusers%2Fuser.model.ts;h=14d13959af129b7ac9716c8535e6ff580a7c601c;hb=0ba5f5baade94a051710d9d9d408ac8083c14ac6;hp=2748001d046c57eb4718d913feb82218f8f94ac3;hpb=eacb25c4366bcc8fba20f98f93f004fabc6d5578;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/users/user.model.ts b/client/src/app/shared/users/user.model.ts index 2748001d0..14d13959a 100644 --- a/client/src/app/shared/users/user.model.ts +++ b/client/src/app/shared/users/user.model.ts @@ -1,59 +1,60 @@ -import { - Account as AccountServerModel, - hasUserRight, - User as UserServerModel, - UserRight, - UserRole, - VideoChannel -} from '../../../../../shared' +import { hasUserRight, User as UserServerModel, UserNotificationSetting, UserRight, UserRole, VideoChannel } from '../../../../../shared' import { NSFWPolicyType } from '../../../../../shared/models/videos/nsfw-policy.type' import { Account } from '@app/shared/account/account.model' import { Avatar } from '../../../../../shared/models/avatars/avatar.model' +import { UserAdminFlag } from '@shared/models/users/user-flag.model' -export type UserConstructorHash = { - id: number, - username: string, - email: string, - role: UserRole, - videoQuota?: number, - nsfwPolicy?: NSFWPolicyType, - autoPlayVideo?: boolean, - createdAt?: Date, - account?: AccountServerModel, - videoChannels?: VideoChannel[] - - blocked?: boolean - blockedReason?: string -} export class User implements UserServerModel { id: number username: string email: string - role: UserRole + pendingEmail: string | null + emailVerified: boolean nsfwPolicy: NSFWPolicyType + + role: UserRole + roleLabel: string + + webTorrentEnabled: boolean autoPlayVideo: boolean + videosHistoryEnabled: boolean + videoQuota: number + videoQuotaDaily: number account: Account videoChannels: VideoChannel[] createdAt: Date + adminFlags?: UserAdminFlag + blocked: boolean blockedReason?: string - constructor (hash: UserConstructorHash) { + notificationSettings?: UserNotificationSetting + + constructor (hash: Partial) { this.id = hash.id this.username = hash.username this.email = hash.email + this.role = hash.role this.videoChannels = hash.videoChannels this.videoQuota = hash.videoQuota + this.videoQuotaDaily = hash.videoQuotaDaily this.nsfwPolicy = hash.nsfwPolicy + this.webTorrentEnabled = hash.webTorrentEnabled + this.videosHistoryEnabled = hash.videosHistoryEnabled this.autoPlayVideo = hash.autoPlayVideo this.createdAt = hash.createdAt + + this.adminFlags = hash.adminFlags + this.blocked = hash.blocked this.blockedReason = hash.blockedReason + this.notificationSettings = hash.notificationSettings + if (hash.account !== undefined) { this.account = new Account(hash.account) }