summaryrefslogtreecommitdiff
path: root/internal/processing/fromcommon.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-09-27 17:42:20 +0200
committerLibravatar GitHub <noreply@github.com>2021-09-27 17:42:20 +0200
commitb3fd9c39a3a6ecdac87b27684e7dbc54ce19b312 (patch)
treeecd482e18eb6131d07a092949556fec623ec2ec7 /internal/processing/fromcommon.go
parentUnblock fix (#247) (diff)
downloadgotosocial-b3fd9c39a3a6ecdac87b27684e7dbc54ce19b312.tar.xz
Weird notif issue (#248)
* start working on weird issue * go fmt ./... * more tests
Diffstat (limited to 'internal/processing/fromcommon.go')
-rw-r--r--internal/processing/fromcommon.go13
1 files changed, 11 insertions, 2 deletions
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
}