mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-30 12:16:14 -06:00
further tidying in fromClientAPI
This commit is contained in:
parent
ec4b3c9e4f
commit
784b648c33
1 changed files with 6 additions and 4 deletions
|
|
@ -117,10 +117,7 @@ func (p *processor) processCreateStatusFromClientAPI(ctx context.Context, client
|
|||
return err
|
||||
}
|
||||
|
||||
if status.Federated {
|
||||
return p.federateStatus(ctx, status)
|
||||
}
|
||||
return nil
|
||||
return p.federateStatus(ctx, status)
|
||||
}
|
||||
|
||||
func (p *processor) processCreateFollowRequestFromClientAPI(ctx context.Context, clientMsg messages.FromClientAPI) error {
|
||||
|
|
@ -307,6 +304,11 @@ func (p *processor) processDeleteAccountFromClientAPI(ctx context.Context, clien
|
|||
// TODO: move all the below functions into federation.Federator
|
||||
|
||||
func (p *processor) federateStatus(ctx context.Context, status *gtsmodel.Status) error {
|
||||
// do nothing if the status shouldn't be federated
|
||||
if !status.Federated {
|
||||
return nil
|
||||
}
|
||||
|
||||
if status.Account == nil {
|
||||
statusAccount, err := p.db.GetAccountByID(ctx, status.AccountID)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue