From b3fd9c39a3a6ecdac87b27684e7dbc54ce19b312 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Mon, 27 Sep 2021 17:42:20 +0200 Subject: Weird notif issue (#248) * start working on weird issue * go fmt ./... * more tests --- internal/processing/fromcommon.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'internal/processing/fromcommon.go') diff --git a/internal/processing/fromcommon.go b/internal/processing/fromcommon.go index 613ad5fca..88d7405a8 100644 --- a/internal/processing/fromcommon.go +++ b/internal/processing/fromcommon.go @@ -190,8 +190,17 @@ func (p *processor) notifyFollow(ctx context.Context, follow *gtsmodel.Follow, t return nil } -func (p *processor) notifyFave(ctx context.Context, fave *gtsmodel.StatusFave, targetAccount *gtsmodel.Account) error { - // return if this isn't a local account +func (p *processor) notifyFave(ctx context.Context, fave *gtsmodel.StatusFave) error { + if fave.TargetAccount == nil { + a, err := p.db.GetAccountByID(ctx, fave.TargetAccountID) + if err != nil { + return err + } + fave.TargetAccount = a + } + targetAccount := fave.TargetAccount + + // just return if target isn't a local account if targetAccount.Domain != "" { return nil } -- cgit v1.2.3