diff options
author | 2021-07-09 18:32:48 +0200 | |
---|---|---|
committer | 2021-07-09 18:32:48 +0200 | |
commit | c7da64922f8b41daaee1cb8fc2961f7fa1336737 (patch) | |
tree | b1f9c946bd223267f87f2a77a7455974d8d5e5e9 /internal/db/db.go | |
parent | Docs (#94) (diff) | |
download | gotosocial-c7da64922f8b41daaee1cb8fc2961f7fa1336737.tar.xz |
favourites GET implementation (#95)
Diffstat (limited to 'internal/db/db.go')
-rw-r--r-- | internal/db/db.go | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/internal/db/db.go b/internal/db/db.go index 1d7ed8b58..0a3979df6 100644 --- a/internal/db/db.go +++ b/internal/db/db.go @@ -241,13 +241,26 @@ type DB interface { // This slice will be unfiltered, not taking account of blocks and whatnot, so filter it before serving it back to a user. WhoBoostedStatus(status *gtsmodel.Status) ([]*gtsmodel.Account, error) - // GetStatusesWhereFollowing returns a slice of statuses from accounts that are followed by the given account id. - GetStatusesWhereFollowing(accountID string, maxID string, sinceID string, minID string, limit int, local bool) ([]*gtsmodel.Status, error) + // GetHomeTimelineForAccount returns a slice of statuses from accounts that are followed by the given account id. + // + // Statuses should be returned in descending order of when they were created (newest first). + GetHomeTimelineForAccount(accountID string, maxID string, sinceID string, minID string, limit int, local bool) ([]*gtsmodel.Status, error) - // GetPublicTimelineForAccount fetches the account's PUBLIC timline -- ie., posts and replies that are public. + // GetPublicTimelineForAccount fetches the account's PUBLIC timeline -- ie., posts and replies that are public. // It will use the given filters and try to return as many statuses as possible up to the limit. + // + // Statuses should be returned in descending order of when they were created (newest first). GetPublicTimelineForAccount(accountID string, maxID string, sinceID string, minID string, limit int, local bool) ([]*gtsmodel.Status, error) + // GetFavedTimelineForAccount fetches the account's FAVED timeline -- ie., posts and replies that the requesting account has faved. + // It will use the given filters and try to return as many statuses as possible up to the limit. + // + // Note that unlike the other GetTimeline functions, the returned statuses will be arranged by their FAVE id, not the STATUS id. + // In other words, they'll be returned in descending order of when they were faved by the requesting user, not when they were created. + // + // Also note the extra return values, which correspond to the nextMaxID and prevMinID for building Link headers. + GetFavedTimelineForAccount(accountID string, maxID string, minID string, limit int) ([]*gtsmodel.Status, string, string, error) + // GetNotificationsForAccount returns a list of notifications that pertain to the given accountID. GetNotificationsForAccount(accountID string, limit int, maxID string, sinceID string) ([]*gtsmodel.Notification, error) |