From c15002d76e2f09118bc0d7435d48bc7265416b18 Mon Sep 17 00:00:00 2001 From: tobi Date: Sat, 3 May 2025 10:10:23 +0000 Subject: [PATCH] [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 Co-committed-by: tobi --- internal/processing/account/follow.go | 14 +++++++------- 1 file 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,