mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[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>
This commit is contained in:
@@ -258,13 +258,9 @@ func (p *Processor) unfollow(ctx context.Context, requestingAccount *gtsmodel.Ac
|
|||||||
msgs = append(msgs, &messages.FromClientAPI{
|
msgs = append(msgs, &messages.FromClientAPI{
|
||||||
APObjectType: ap.ActivityFollow,
|
APObjectType: ap.ActivityFollow,
|
||||||
APActivityType: ap.ActivityUndo,
|
APActivityType: ap.ActivityUndo,
|
||||||
GTSModel: >smodel.Follow{
|
GTSModel: follow,
|
||||||
AccountID: requestingAccount.ID,
|
Origin: requestingAccount,
|
||||||
TargetAccountID: targetAccount.ID,
|
Target: targetAccount,
|
||||||
URI: follow.URI,
|
|
||||||
},
|
|
||||||
Origin: requestingAccount,
|
|
||||||
Target: targetAccount,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -294,9 +290,13 @@ func (p *Processor) unfollow(ctx context.Context, requestingAccount *gtsmodel.Ac
|
|||||||
msgs = append(msgs, &messages.FromClientAPI{
|
msgs = append(msgs, &messages.FromClientAPI{
|
||||||
APObjectType: ap.ActivityFollow,
|
APObjectType: ap.ActivityFollow,
|
||||||
APActivityType: ap.ActivityUndo,
|
APActivityType: ap.ActivityUndo,
|
||||||
|
// Dummy out a follow to undo,
|
||||||
|
// based on the follow request.
|
||||||
GTSModel: >smodel.Follow{
|
GTSModel: >smodel.Follow{
|
||||||
AccountID: requestingAccount.ID,
|
AccountID: requestingAccount.ID,
|
||||||
|
Account: requestingAccount,
|
||||||
TargetAccountID: targetAccount.ID,
|
TargetAccountID: targetAccount.ID,
|
||||||
|
TargetAccount: targetAccount,
|
||||||
URI: followReq.URI,
|
URI: followReq.URI,
|
||||||
},
|
},
|
||||||
Origin: requestingAccount,
|
Origin: requestingAccount,
|
||||||
|
Reference in New Issue
Block a user