mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 20:52:24 -05:00
Blocklist import (#77)
* first steps on importing blocklists * unblock domains properly
This commit is contained in:
parent
d389e7b150
commit
3568579218
25 changed files with 547 additions and 170 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue