summaryrefslogtreecommitdiff
path: root/internal/db/bundb/status.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/db/bundb/status.go')
-rw-r--r--internal/db/bundb/status.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/internal/db/bundb/status.go b/internal/db/bundb/status.go
index b52c06978..709105f72 100644
--- a/internal/db/bundb/status.go
+++ b/internal/db/bundb/status.go
@@ -67,6 +67,24 @@ func (s *statusDB) GetStatusByID(ctx context.Context, id string) (*gtsmodel.Stat
)
}
+func (s *statusDB) GetStatuses(ctx context.Context, ids []string) ([]*gtsmodel.Status, db.Error) {
+ statuses := make([]*gtsmodel.Status, 0, len(ids))
+
+ for _, id := range ids {
+ // Attempt fetch from DB
+ status, err := s.GetStatusByID(ctx, id)
+ if err != nil {
+ log.Errorf("GetStatuses: error getting status %q: %v", id, err)
+ continue
+ }
+
+ // Append status
+ statuses = append(statuses, status)
+ }
+
+ return statuses, nil
+}
+
func (s *statusDB) GetStatusByURI(ctx context.Context, uri string) (*gtsmodel.Status, db.Error) {
return s.getStatus(
ctx,