From 356857921897c0fb91add7f94e8944dd7e6c57b5 Mon Sep 17 00:00:00 2001 From: Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com> Date: Tue, 6 Jul 2021 13:29:11 +0200 Subject: Blocklist import (#77) * first steps on importing blocklists * unblock domains properly --- internal/processing/fromclientapi.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'internal/processing/fromclientapi.go') diff --git a/internal/processing/fromclientapi.go b/internal/processing/fromclientapi.go index 3cb21569a..cfed3b5e4 100644 --- a/internal/processing/fromclientapi.go +++ b/internal/processing/fromclientapi.go @@ -193,17 +193,17 @@ func (p *processor) processFromClientAPI(clientMsg gtsmodel.FromClientAPI) error return p.federateStatusDelete(statusToDelete) case gtsmodel.ActivityStreamsProfile, gtsmodel.ActivityStreamsPerson: // DELETE ACCOUNT/PROFILE - accountToDelete, ok := clientMsg.GTSModel.(*gtsmodel.Account) - if !ok { - return errors.New("account was not parseable as *gtsmodel.Account") - } - var deletedBy string - if clientMsg.OriginAccount != nil { - deletedBy = clientMsg.OriginAccount.ID + // the origin of the delete could be either a domain block, or an action by another (or this) account + var origin string + if domainBlock, ok := clientMsg.GTSModel.(*gtsmodel.DomainBlock); ok { + // origin is a domain block + origin = domainBlock.ID + } else { + // origin is whichever account caused this message + origin = clientMsg.OriginAccount.ID } - - return p.accountProcessor.Delete(accountToDelete, deletedBy) + return p.accountProcessor.Delete(clientMsg.TargetAccount, origin) } } return nil -- cgit v1.2.3