From 94cbe1120e0364d0994989dff7722d0bf6e2ac07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nicole=20miko=C5=82ajczyk?= Date: Mon, 14 Jul 2025 17:12:47 +0200 Subject: [PATCH] [bugfix] use correct interaction type for pre-accepted interaction requests (#4325) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nicole mikołajczyk # Description > If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements. > > If this is a documentation change, please briefly describe what you've changed and why. This pull request fixes `InteractionType` incorrectly set for pre-approved interaction requests. ## Checklist Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]` If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want). - [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md). - [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat. - [x] I/we have not leveraged AI to create the proposed changes. - [x] I/we have performed a self-review of added code. - [x] I/we have written code that is legible and maintainable by others. - [ ] I/we have commented the added code, particularly in hard-to-understand areas. - [ ] I/we have made any necessary changes to documentation. - [ ] I/we have added tests that cover new code. - [x] I/we have run tests and they pass locally with the changes. - [x] I/we have run `go fmt ./...` and `golangci-lint run`. Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4325 Co-authored-by: nicole mikołajczyk Co-committed-by: nicole mikołajczyk --- internal/processing/workers/fromclientapi.go | 4 ++-- internal/processing/workers/fromfediapi.go | 4 ++-- internal/processing/workers/util.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/processing/workers/fromclientapi.go b/internal/processing/workers/fromclientapi.go index 9ea37a2f2..32b3d8816 100644 --- a/internal/processing/workers/fromclientapi.go +++ b/internal/processing/workers/fromclientapi.go @@ -319,7 +319,7 @@ func (p *clientAPI) CreateStatus(ctx context.Context, cMsg *messages.FromClientA InteractingAccountID: status.AccountID, InteractingAccount: status.Account, InteractionURI: status.URI, - InteractionType: gtsmodel.InteractionLike, + InteractionType: gtsmodel.InteractionReply, Reply: status, URI: uris.GenerateURIForAccept(status.InReplyToAccount.Username, id), AcceptedAt: time.Now(), @@ -621,7 +621,7 @@ func (p *clientAPI) CreateAnnounce(ctx context.Context, cMsg *messages.FromClien InteractingAccountID: boost.AccountID, InteractingAccount: boost.Account, InteractionURI: boost.URI, - InteractionType: gtsmodel.InteractionLike, + InteractionType: gtsmodel.InteractionAnnounce, Announce: boost, URI: uris.GenerateURIForAccept(boost.BoostOfAccount.Username, id), AcceptedAt: time.Now(), diff --git a/internal/processing/workers/fromfediapi.go b/internal/processing/workers/fromfediapi.go index 926825b69..1a42a04fb 100644 --- a/internal/processing/workers/fromfediapi.go +++ b/internal/processing/workers/fromfediapi.go @@ -316,7 +316,7 @@ func (p *fediAPI) CreateStatus(ctx context.Context, fMsg *messages.FromFediAPI) InteractingAccountID: status.AccountID, InteractingAccount: status.Account, InteractionURI: status.URI, - InteractionType: gtsmodel.InteractionLike, + InteractionType: gtsmodel.InteractionReply, Reply: status, URI: uris.GenerateURIForAccept(status.InReplyToAccount.Username, id), AcceptedAt: time.Now(), @@ -657,7 +657,7 @@ func (p *fediAPI) CreateAnnounce(ctx context.Context, fMsg *messages.FromFediAPI InteractingAccountID: boost.AccountID, InteractingAccount: boost.Account, InteractionURI: boost.URI, - InteractionType: gtsmodel.InteractionLike, + InteractionType: gtsmodel.InteractionAnnounce, Announce: boost, URI: uris.GenerateURIForAccept(boost.BoostOfAccount.Username, id), AcceptedAt: time.Now(), diff --git a/internal/processing/workers/util.go b/internal/processing/workers/util.go index b9787456a..3c17eaaf5 100644 --- a/internal/processing/workers/util.go +++ b/internal/processing/workers/util.go @@ -561,7 +561,7 @@ func (u *utils) requestFave( return gtserror.Newf("db error storing interaction request: %w", err) } - // Notify *local* account of pending announce. + // Notify *local* account of pending fave. if err := u.surface.notifyPendingFave(ctx, fave); err != nil { return gtserror.Newf("error notifying pending fave: %w", err) }