X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Faccount%2Faccount.model.ts;h=61f09fc0627ef5478aef524096074ffcebb2670e;hb=366b21f13f75b33f9d64744d7564e7cddf5b1ae8;hp=1dce0003ca0dd9dd02d57a4024242bc800ac13f9;hpb=4cb6d4578893db310297d7e118ce2fb7ecb952a3;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/account/account.model.ts b/client/src/app/shared/account/account.model.ts index 1dce0003c..61f09fc06 100644 --- a/client/src/app/shared/account/account.model.ts +++ b/client/src/app/shared/account/account.model.ts @@ -1,25 +1,30 @@ import { Account as ServerAccount } from '../../../../../shared/models/actors/account.model' -import { Avatar } from '../../../../../shared/models/avatars/avatar.model' -import { getAbsoluteAPIUrl } from '../misc/utils' +import { Actor } from '../actor/actor.model' -export class Account implements ServerAccount { - id: number - uuid: string - url: string - name: string +export class Account extends Actor implements ServerAccount { displayName: string - host: string - followingCount: number - followersCount: number - createdAt: Date - updatedAt: Date - avatar: Avatar + description: string + nameWithHost: string + nameWithHostForced: string + mutedByUser: boolean + mutedByInstance: boolean + mutedServerByUser: boolean + mutedServerByInstance: boolean - static GET_ACCOUNT_AVATAR_URL (account: Account) { - const absoluteAPIUrl = getAbsoluteAPIUrl() + userId?: number - if (account && account.avatar) return absoluteAPIUrl + account.avatar.path + constructor (hash: ServerAccount) { + super(hash) - return window.location.origin + '/client/assets/images/default-avatar.png' + this.displayName = hash.displayName + this.description = hash.description + this.userId = hash.userId + this.nameWithHost = Actor.CREATE_BY_STRING(this.name, this.host) + this.nameWithHostForced = Actor.CREATE_BY_STRING(this.name, this.host, true) + + this.mutedByUser = false + this.mutedByInstance = false + this.mutedServerByUser = false + this.mutedServerByInstance = false } }