From c5911fd347c76e8bdc05ea9f3ee9efed4a58c236 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 29 Dec 2017 19:10:13 +0100 Subject: Begin to add avatar to actors --- server/models/account/account.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'server/models/account/account.ts') diff --git a/server/models/account/account.ts b/server/models/account/account.ts index 1ee232537..d3503aaa3 100644 --- a/server/models/account/account.ts +++ b/server/models/account/account.ts @@ -13,6 +13,7 @@ import { Table, UpdatedAt } from 'sequelize-typescript' +import { Account } from '../../../shared/models/actors' import { isUserUsernameValid } from '../../helpers/custom-validators/users' import { sendDeleteActor } from '../../lib/activitypub/send' import { ActorModel } from '../activitypub/actor' @@ -165,11 +166,12 @@ export class AccountModel extends Model { return AccountModel.findOne(query) } - toFormattedJSON () { + toFormattedJSON (): Account { const actor = this.Actor.toFormattedJSON() const account = { id: this.id, - name: this.name, + name: this.Actor.preferredUsername, + displayName: this.name, createdAt: this.createdAt, updatedAt: this.updatedAt } -- cgit v1.2.3