mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-17 20:23:02 -06:00
remote + local block logic, incl. federation
This commit is contained in:
parent
c7da64922f
commit
861cc1dff1
32 changed files with 1126 additions and 44 deletions
|
|
@ -34,7 +34,7 @@ func (p *processor) processFromFederator(federatorMsg gtsmodel.FromFederator) er
|
|||
"federatorMsg": fmt.Sprintf("%+v", federatorMsg),
|
||||
})
|
||||
|
||||
l.Debug("entering function PROCESS FROM FEDERATOR")
|
||||
l.Trace("entering function PROCESS FROM FEDERATOR")
|
||||
|
||||
switch federatorMsg.APActivityType {
|
||||
case gtsmodel.ActivityStreamsCreate:
|
||||
|
|
@ -47,7 +47,7 @@ func (p *processor) processFromFederator(federatorMsg gtsmodel.FromFederator) er
|
|||
return errors.New("note was not parseable as *gtsmodel.Status")
|
||||
}
|
||||
|
||||
l.Debug("will now derefence incoming status")
|
||||
l.Trace("will now derefence incoming status")
|
||||
if err := p.federator.DereferenceStatusFields(incomingStatus, federatorMsg.ReceivingAccount.Username); err != nil {
|
||||
return fmt.Errorf("error dereferencing status from federator: %s", err)
|
||||
}
|
||||
|
|
@ -70,7 +70,7 @@ func (p *processor) processFromFederator(federatorMsg gtsmodel.FromFederator) er
|
|||
return errors.New("profile was not parseable as *gtsmodel.Account")
|
||||
}
|
||||
|
||||
l.Debug("will now derefence incoming account")
|
||||
l.Trace("will now derefence incoming account")
|
||||
if err := p.federator.DereferenceAccountFields(incomingAccount, "", false); err != nil {
|
||||
return fmt.Errorf("error dereferencing account from federator: %s", err)
|
||||
}
|
||||
|
|
@ -127,6 +127,12 @@ func (p *processor) processFromFederator(federatorMsg gtsmodel.FromFederator) er
|
|||
if err := p.notifyAnnounce(incomingAnnounce); err != nil {
|
||||
return err
|
||||
}
|
||||
case gtsmodel.ActivityStreamsBlock:
|
||||
// CREATE A BLOCK
|
||||
|
||||
// TODO: remove any of the blocking account's statuses from the blocked account's timeline
|
||||
// TODO: same with notifications
|
||||
// TODO: same with bookmarks
|
||||
}
|
||||
case gtsmodel.ActivityStreamsUpdate:
|
||||
// UPDATE
|
||||
|
|
@ -138,7 +144,7 @@ func (p *processor) processFromFederator(federatorMsg gtsmodel.FromFederator) er
|
|||
return errors.New("profile was not parseable as *gtsmodel.Account")
|
||||
}
|
||||
|
||||
l.Debug("will now derefence incoming account")
|
||||
l.Trace("will now derefence incoming account")
|
||||
if err := p.federator.DereferenceAccountFields(incomingAccount, federatorMsg.ReceivingAccount.Username, true); err != nil {
|
||||
return fmt.Errorf("error dereferencing account from federator: %s", err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue