Refresh orphan actors

pull/837/head
Chocobozzz 2018-07-31 11:04:33 +02:00
parent 365b546c9f
commit 25e4d6ee97
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 5 additions and 0 deletions

View File

@ -40,6 +40,11 @@ async function getOrCreateActorAndServerAndModel (activityActor: string | Activi
const actorUrl = getActorUrl(activityActor) const actorUrl = getActorUrl(activityActor)
let actor = await ActorModel.loadByUrl(actorUrl) let actor = await ActorModel.loadByUrl(actorUrl)
// Orphan actor (not associated to an account of channel) so recreate it
if (!actor.Account && !actor.VideoChannel) {
await actor.destroy()
actor = null
}
// We don't have this actor in our database, fetch it on remote // We don't have this actor in our database, fetch it on remote
if (!actor) { if (!actor) {