summaryrefslogtreecommitdiff
path: root/internal/db/db.go
diff options
context:
space:
mode:
authorLibravatar Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com>2021-06-17 18:02:33 +0200
committerLibravatar GitHub <noreply@github.com>2021-06-17 18:02:33 +0200
commit82d9f88e424fffacfa9a9c1c26f2f702b97f3e3a (patch)
tree60379f8eb809e9019222f67a13b547e4a26bfc83 /internal/db/db.go
parentTimeline manager (#40) (diff)
downloadgotosocial-82d9f88e424fffacfa9a9c1c26f2f702b97f3e3a.tar.xz
Timeline improvements (#41)
Tidying up. Parent/child statuses now display correctly in status/id/context.
Diffstat (limited to 'internal/db/db.go')
-rw-r--r--internal/db/db.go24
1 files changed, 6 insertions, 18 deletions
diff --git a/internal/db/db.go b/internal/db/db.go
index 51685f024..4e21358c3 100644
--- a/internal/db/db.go
+++ b/internal/db/db.go
@@ -199,21 +199,6 @@ type DB interface {
// GetRelationship retrieves the relationship of the targetAccount to the requestingAccount.
GetRelationship(requestingAccount string, targetAccount string) (*gtsmodel.Relationship, error)
- // StatusVisible returns true if targetStatus is visible to requestingAccount, based on the
- // privacy settings of the status, and any blocks/mutes that might exist between the two accounts
- // or account domains.
- //
- // StatusVisible will also check through the given slice of 'otherRelevantAccounts', which should include:
- //
- // 1. Accounts mentioned in the targetStatus
- //
- // 2. Accounts replied to by the target status
- //
- // 3. Accounts boosted by the target status
- //
- // Will return an error if something goes wrong while pulling stuff out of the database.
- StatusVisible(targetStatus *gtsmodel.Status, requestingAccount *gtsmodel.Account, relevantAccounts *gtsmodel.RelevantAccounts) (bool, error)
-
// Follows returns true if sourceAccount follows target account, or an error if something goes wrong while finding out.
Follows(sourceAccount *gtsmodel.Account, targetAccount *gtsmodel.Account) (bool, error)
@@ -223,9 +208,6 @@ type DB interface {
// Mutuals returns true if account1 and account2 both follow each other, or an error if something goes wrong while finding out.
Mutuals(account1 *gtsmodel.Account, account2 *gtsmodel.Account) (bool, error)
- // PullRelevantAccountsFromStatus returns all accounts mentioned in a status, replied to by a status, or boosted by a status
- PullRelevantAccountsFromStatus(status *gtsmodel.Status) (*gtsmodel.RelevantAccounts, error)
-
// GetReplyCountForStatus returns the amount of replies recorded for a status, or an error if something goes wrong
GetReplyCountForStatus(status *gtsmodel.Status) (int, error)
@@ -235,6 +217,12 @@ type DB interface {
// GetFaveCountForStatus returns the amount of faves/likes recorded for a status, or an error if something goes wrong
GetFaveCountForStatus(status *gtsmodel.Status) (int, error)
+ // StatusParents get the parent statuses of a given status.
+ StatusParents(status *gtsmodel.Status) ([]*gtsmodel.Status, error)
+
+ // StatusChildren gets the child statuses of a given status.
+ StatusChildren(status *gtsmodel.Status) ([]*gtsmodel.Status, error)
+
// StatusFavedBy checks if a given status has been faved by a given account ID
StatusFavedBy(status *gtsmodel.Status, accountID string) (bool, error)