handle remote account deletion more systematically (#254)

This commit is contained in:
tobi 2021-09-30 10:56:02 +02:00 committed by GitHub
commit 36a09dd0df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 212 additions and 13 deletions

View file

@ -89,10 +89,7 @@ func (f *federatingDB) Delete(ctx context.Context, id *url.URL) error {
a, err := f.db.GetAccountByURI(ctx, id.String())
if err == nil {
// it's an account
l.Debugf("uri is for an account with id: %s", a.ID)
if err := f.db.DeleteByID(ctx, a.ID, &gtsmodel.Account{}); err != nil {
return fmt.Errorf("DELETE: err deleting account: %s", err)
}
l.Debugf("uri is for an account with id %s, passing delete message to the processor", a.ID)
fromFederatorChan <- messages.FromFederator{
APObjectType: ap.ObjectProfile,
APActivityType: ap.ActivityDelete,