+ const objectUrl = typeof activity.object === 'string' ? activity.object : activity.object.id
+
+ if (activity.actor === objectUrl) {
+ // We need more attributes (all the account and channel)
+ const byActorFull = await ActorModel.loadByUrlAndPopulateAccountAndChannel(byActor.url)
+
+ if (byActorFull.type === 'Person') {
+ if (!byActorFull.Account) throw new Error('Actor ' + byActorFull.url + ' is a person but we cannot find it in database.')
+
+ const accountToDelete = byActorFull.Account as MAccountActor
+ accountToDelete.Actor = byActorFull
+
+ return retryTransactionWrapper(processDeleteAccount, accountToDelete)
+ } else if (byActorFull.type === 'Group') {
+ if (!byActorFull.VideoChannel) throw new Error('Actor ' + byActorFull.url + ' is a group but we cannot find it in database.')
+
+ const channelToDelete = byActorFull.VideoChannel as MChannelActorAccountActor
+ channelToDelete.Actor = byActorFull
+
+ return retryTransactionWrapper(processDeleteVideoChannel, channelToDelete)
+ }