summaryrefslogtreecommitdiff
path: root/internal/processing
diff options
context:
space:
mode:
authorLibravatar tobi <tobi.smethurst@protonmail.com>2025-05-03 10:10:23 +0000
committerLibravatar tobi <kipvandenbos@noreply.codeberg.org>2025-05-03 10:10:23 +0000
commitc15002d76e2f09118bc0d7435d48bc7265416b18 (patch)
treeeef2e0baab86aecc51b9ebb17fbb4c3a2b9ac6b1 /internal/processing
parent[chore/docs] fix relative link to scraper deterrence (#4111) (diff)
downloadgotosocial-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.go14
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: &gtsmodel.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: &gtsmodel.Follow{
AccountID: requestingAccount.ID,
+ Account: requestingAccount,
TargetAccountID: targetAccount.ID,
+ TargetAccount: targetAccount,
URI: followReq.URI,
},
Origin: requestingAccount,