mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-30 13:36:15 -06:00
tidy up federation call
This commit is contained in:
parent
98581c0da6
commit
118d51a2cd
1 changed files with 1 additions and 10 deletions
|
|
@ -161,22 +161,13 @@ func (p *processor) processCreateFollowRequestFromFederator(ctx context.Context,
|
|||
return p.notifyFollowRequest(ctx, followRequest)
|
||||
}
|
||||
|
||||
if followRequest.Account == nil {
|
||||
a, err := p.db.GetAccountByID(ctx, followRequest.AccountID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
followRequest.Account = a
|
||||
}
|
||||
originAccount := followRequest.Account
|
||||
|
||||
// if the target account isn't locked, we should already accept the follow and notify about the new follower instead
|
||||
follow, err := p.db.AcceptFollowRequest(ctx, followRequest.AccountID, followRequest.TargetAccountID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := p.federateAcceptFollowRequest(ctx, follow, originAccount, targetAccount); err != nil {
|
||||
if err := p.federateAcceptFollowRequest(ctx, follow); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue