summaryrefslogtreecommitdiff
path: root/internal/db/status.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2023-12-15 14:24:39 +0000
committerLibravatar GitHub <noreply@github.com>2023-12-15 15:24:39 +0100
commitf4fcffc8b56ef73c184ae17892b69181961c15c7 (patch)
treeb678c44c9106e2ec8069dcf596a0554dee7410ab /internal/db/status.go
parent[bugfix] Let templates deref pointers, as a treat (#2448) (diff)
downloadgotosocial-f4fcffc8b56ef73c184ae17892b69181961c15c7.tar.xz
[bugfix] use a much shorter refresh limit for statuses with polls (#2453)v0.13.0
* specifically use a much shorter refresh limit for statuses with polls * allow specifying whether status must be upToDate in calls to Get(Visible)?TargetStatusBy_(), limit force refresh to 5 minute cooldown * remove the PollID check from statusUpToDate() * remove unnecessary force flag checks * remove unused field * check refresh status error * use argument name 'refresh' instead of 'upToDate' to better fit with the codebase * add statuses_poll_id_idx * remove the definitely-not copy-pasted comment i accidentally typed out in full * only synchronously refresh if the refresh flag is provided, otherwise do async * fix wrong force value being provided for async --------- Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Diffstat (limited to 'internal/db/status.go')
-rw-r--r--internal/db/status.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/internal/db/status.go b/internal/db/status.go
index 1ebf503a8..8034d39e7 100644
--- a/internal/db/status.go
+++ b/internal/db/status.go
@@ -25,15 +25,18 @@ import (
// Status contains functions for getting statuses, creating statuses, and checking various other fields on statuses.
type Status interface {
- // GetStatusByID returns one status from the database, with no rel fields populated, only their linking ID / URIs
+ // GetStatusByID fetches the status from the database with matching id column.
GetStatusByID(ctx context.Context, id string) (*gtsmodel.Status, error)
- // GetStatusByURI returns one status from the database, with no rel fields populated, only their linking ID / URIs
+ // GetStatusByURI fetches the status from the database with matching uri column.
GetStatusByURI(ctx context.Context, uri string) (*gtsmodel.Status, error)
- // GetStatusByURL returns one status from the database, with no rel fields populated, only their linking ID / URIs
+ // GetStatusByURL fetches the status from the database with matching url column.
GetStatusByURL(ctx context.Context, uri string) (*gtsmodel.Status, error)
+ // GetStatusByPollID fetches the status from the database with matching poll_id column.
+ GetStatusByPollID(ctx context.Context, pollID string) (*gtsmodel.Status, error)
+
// GetStatusBoost fetches the status whose boost_of_id column refers to boostOfID, authored by given account ID.
GetStatusBoost(ctx context.Context, boostOfID string, byAccountID string) (*gtsmodel.Status, error)