mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 18:42:26 -05: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:
parent
bad427e7f0
commit
c15002d76e
1 changed files with 7 additions and 7 deletions
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue