-import { Account as ServerAccount } from '../../../../../shared/models/accounts/account.model'
-import { Avatar } from '../../../../../shared/models/avatars/avatar.model'
-import { environment } from '../../../environments/environment'
+import { Account as ServerAccount } from '../../../../../shared/models/actors/account.model'
+import { Actor } from '../actor/actor.model'
-export class Account implements ServerAccount {
- id: number
- uuid: string
- name: string
- host: string
- followingCount: number
- followersCount: number
- createdAt: Date
- updatedAt: Date
- avatar: Avatar
+export class Account extends Actor implements ServerAccount {
+ displayName: string
+ description: string
+ nameWithHost: string
- static GET_ACCOUNT_AVATAR_PATH (account: Account) {
- if (account && account.avatar) return account.avatar.path
+ constructor (hash: ServerAccount) {
+ super(hash)
- return environment.apiUrl + '/client/assets/images/default-avatar.png'
+ this.displayName = hash.displayName
+ this.description = hash.description
+ this.nameWithHost = Actor.CREATE_BY_STRING(this.name, this.host)
}
}