mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-17 13:23:01 -06:00
unblock domains properly
This commit is contained in:
parent
8285d09da5
commit
e8f1c33b48
15 changed files with 316 additions and 130 deletions
|
|
@ -64,5 +64,20 @@ func (p *processor) DomainBlockDelete(account *gtsmodel.Account, id string) (*ap
|
|||
}
|
||||
}
|
||||
|
||||
// unsuspend all accounts whose suspension origin was this domain block
|
||||
// 1. remove the 'suspended_at' entry from their accounts
|
||||
if err := p.db.UpdateWhere([]db.Where{
|
||||
{Key: "suspension_origin", Value: domainBlock.ID},
|
||||
}, "suspended_at", nil, &[]*gtsmodel.Account{}); err != nil {
|
||||
return nil, gtserror.NewErrorInternalError(fmt.Errorf("database error removing suspended_at from accounts: %s", err))
|
||||
}
|
||||
|
||||
// 2. remove the 'suspension_origin' entry from their accounts
|
||||
if err := p.db.UpdateWhere([]db.Where{
|
||||
{Key: "suspension_origin", Value: domainBlock.ID},
|
||||
}, "suspension_origin", nil, &[]*gtsmodel.Account{}); err != nil {
|
||||
return nil, gtserror.NewErrorInternalError(fmt.Errorf("database error removing suspension_origin from accounts: %s", err))
|
||||
}
|
||||
|
||||
return mastoDomainBlock, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue