summaryrefslogtreecommitdiff
path: root/internal/processing/fromcommon.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-09-04 13:29:56 +0200
committerLibravatar GitHub <noreply@github.com>2021-09-04 13:29:56 +0200
commitff05046df7c0ce21f70b0dd8dce59dd5e01771de (patch)
tree227720dc9ca30da106e508108eba08426e8bd2ee /internal/processing/fromcommon.go
parentMerge pull request #186 from superseriousbusiness/struct_validation (diff)
downloadgotosocial-ff05046df7c0ce21f70b0dd8dce59dd5e01771de.tar.xz
tests + announce notification fix (#193)
Diffstat (limited to 'internal/processing/fromcommon.go')
-rw-r--r--internal/processing/fromcommon.go14
1 files changed, 6 insertions, 8 deletions
diff --git a/internal/processing/fromcommon.go b/internal/processing/fromcommon.go
index b7a6defc3..613ad5fca 100644
--- a/internal/processing/fromcommon.go
+++ b/internal/processing/fromcommon.go
@@ -61,17 +61,15 @@ func (p *processor) notifyStatus(ctx context.Context, status *gtsmodel.Status) e
}
// make sure a notif doesn't already exist for this mention
- err := p.db.GetWhere(ctx, []db.Where{
+ if err := p.db.GetWhere(ctx, []db.Where{
{Key: "notification_type", Value: gtsmodel.NotificationMention},
{Key: "target_account_id", Value: m.TargetAccountID},
- {Key: "origin_account_id", Value: status.AccountID},
- {Key: "status_id", Value: status.ID},
- }, &gtsmodel.Notification{})
- if err == nil {
+ {Key: "origin_account_id", Value: m.OriginAccountID},
+ {Key: "status_id", Value: m.StatusID},
+ }, &gtsmodel.Notification{}); err == nil {
// notification exists already so just continue
continue
- }
- if err != db.ErrNoEntries {
+ } else if err != db.ErrNoEntries {
// there's a real error in the db
return fmt.Errorf("notifyStatus: error checking existence of notification for mention with id %s : %s", m.ID, err)
}
@@ -254,7 +252,7 @@ func (p *processor) notifyAnnounce(ctx context.Context, status *gtsmodel.Status)
status.BoostOfAccount = boostedAcct
}
- if status.BoostOfAccount.Domain == "" {
+ if status.BoostOfAccount.Domain != "" {
// remote account, nothing to do
return nil
}