summaryrefslogtreecommitdiff
path: root/internal/message/fromfederatorprocess.go
diff options
context:
space:
mode:
authorLibravatar Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com>2021-05-29 19:39:43 +0200
committerLibravatar GitHub <noreply@github.com>2021-05-29 19:39:43 +0200
commit1fe5e36ac3a631a53724fe99583b7f11baa32c53 (patch)
tree40ae75c3613c9c6915273f98fe7ce41046d11381 /internal/message/fromfederatorprocess.go
parentfederate account updates (diff)
downloadgotosocial-1fe5e36ac3a631a53724fe99583b7f11baa32c53.tar.xz
Search (#36)
First implementation of search functionality for remote account and status lookups.
Diffstat (limited to 'internal/message/fromfederatorprocess.go')
-rw-r--r--internal/message/fromfederatorprocess.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/message/fromfederatorprocess.go b/internal/message/fromfederatorprocess.go
index 7fbdacbf9..b070cc46d 100644
--- a/internal/message/fromfederatorprocess.go
+++ b/internal/message/fromfederatorprocess.go
@@ -105,7 +105,9 @@ func (p *processor) processFromFederator(federatorMsg gtsmodel.FromFederator) er
}
if err := p.db.Put(incomingAnnounce); err != nil {
- return fmt.Errorf("error adding dereferenced announce to the db: %s", err)
+ if _, ok := err.(db.ErrAlreadyExists); !ok {
+ return fmt.Errorf("error adding dereferenced announce to the db: %s", err)
+ }
}
if err := p.notifyAnnounce(incomingAnnounce); err != nil {
@@ -407,7 +409,7 @@ func (p *processor) dereferenceAnnounce(announce *gtsmodel.Status, requestingUse
}
// now dereference additional fields straight away (we're already async here so we have time)
- if err := p.dereferenceStatusFields(boostedStatus, requestingUsername); err != nil {
+ if err := p.dereferenceStatusFields(boostedStatus, requestingUsername); err != nil {
return fmt.Errorf("dereferenceAnnounce: error dereferencing status fields for status with id %s: %s", announce.GTSBoostedStatus.URI, err)
}