From e04551d796adf69703a41af123207b2624237292 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 30 Jul 2018 11:33:58 +0200 Subject: Delete actor too when deleting account/video channel --- server/models/account/account.ts | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'server/models/account') diff --git a/server/models/account/account.ts b/server/models/account/account.ts index 2eed66fc2..ce0f3f7c5 100644 --- a/server/models/account/account.ts +++ b/server/models/account/account.ts @@ -16,8 +16,6 @@ import { } from 'sequelize-typescript' import { Account } from '../../../shared/models/actors' import { isAccountDescriptionValid } from '../../helpers/custom-validators/accounts' -import { logger } from '../../helpers/logger' -import { sendDeleteActor } from '../../lib/activitypub/send' import { ActorModel } from '../activitypub/actor' import { ApplicationModel } from '../application/application' import { AvatarModel } from '../avatar/avatar' @@ -138,12 +136,7 @@ export class AccountModel extends Model { instance.Actor = await instance.$get('Actor', { transaction: options.transaction }) as ActorModel } - if (instance.isOwned()) { - logger.debug('Sending delete of actor of account %s.', instance.Actor.url) - return sendDeleteActor(instance.Actor, options.transaction) - } - - return undefined + return instance.Actor.destroy({ transaction: options.transaction }) } static load (id: number) { @@ -246,12 +239,12 @@ export class AccountModel extends Model { } return AccountModel.findAndCountAll(query) - .then(({ rows, count }) => { - return { - data: rows, - total: count - } - }) + .then(({ rows, count }) => { + return { + data: rows, + total: count + } + }) } toFormattedJSON (): Account { -- cgit v1.2.3