First implementation of search functionality for remote account and status lookups.
This commit is contained in:
Tobi Smethurst
2021-05-29 19:39:43 +02:00
committed by GitHub
parent cb54324430
commit 1fe5e36ac3
22 changed files with 769 additions and 26 deletions

View File

@@ -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)
}