diff options
| author | 2025-05-03 10:10:23 +0000 | |
|---|---|---|
| committer | 2025-05-03 10:10:23 +0000 | |
| commit | c15002d76e2f09118bc0d7435d48bc7265416b18 (patch) | |
| tree | eef2e0baab86aecc51b9ebb17fbb4c3a2b9ac6b1 /internal/processing | |
| parent | [chore/docs] fix relative link to scraper deterrence (#4111) (diff) | |
| download | gotosocial-c15002d76e2f09118bc0d7435d48bc7265416b18.tar.xz | |
[bugfix] Ensure Account and TargetAccount set when doing UndoFollow (#4118)
Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4112 by ensuring that Account and TargetAccount are properly set on the follow passed through to UndoFollow.
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4118
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
Diffstat (limited to 'internal/processing')
| -rw-r--r-- | internal/processing/account/follow.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/internal/processing/account/follow.go b/internal/processing/account/follow.go index 2c9b1be4e..26d552bbb 100644 --- a/internal/processing/account/follow.go +++ b/internal/processing/account/follow.go @@ -258,13 +258,9 @@ func (p *Processor) unfollow(ctx context.Context, requestingAccount *gtsmodel.Ac msgs = append(msgs, &messages.FromClientAPI{ APObjectType: ap.ActivityFollow, APActivityType: ap.ActivityUndo, - GTSModel: >smodel.Follow{ - AccountID: requestingAccount.ID, - TargetAccountID: targetAccount.ID, - URI: follow.URI, - }, - Origin: requestingAccount, - Target: targetAccount, + GTSModel: follow, + Origin: requestingAccount, + Target: targetAccount, }) } @@ -294,9 +290,13 @@ func (p *Processor) unfollow(ctx context.Context, requestingAccount *gtsmodel.Ac msgs = append(msgs, &messages.FromClientAPI{ APObjectType: ap.ActivityFollow, APActivityType: ap.ActivityUndo, + // Dummy out a follow to undo, + // based on the follow request. GTSModel: >smodel.Follow{ AccountID: requestingAccount.ID, + Account: requestingAccount, TargetAccountID: targetAccount.ID, + TargetAccount: targetAccount, URI: followReq.URI, }, Origin: requestingAccount, |
