diff options
author | 2021-05-17 19:06:58 +0200 | |
---|---|---|
committer | 2021-05-17 19:06:58 +0200 | |
commit | 6cd033449fd328410128bc3e840f4b8d3d74f052 (patch) | |
tree | 9868db8439533e078dea5bb34ae4949e9460f2cb /internal/db/db.go | |
parent | update progress (diff) | |
download | gotosocial-6cd033449fd328410128bc3e840f4b8d3d74f052.tar.xz |
Refine statuses (#26)
Remote media is now dereferenced and attached properly to incoming federated statuses.
Mentions are now dereferenced and attached properly to incoming federated statuses.
Small fixes to status visibility.
Allow URL params for filtering statuses:
// ExcludeRepliesKey is for specifying whether to exclude replies in a list of returned statuses by an account.
// PinnedKey is for specifying whether to include pinned statuses in a list of returned statuses by an account.
// MaxIDKey is for specifying the maximum ID of the status to retrieve.
// MediaOnlyKey is for specifying that only statuses with media should be returned in a list of returned statuses by an account.
Add endpoint for fetching an account's statuses.
Diffstat (limited to 'internal/db/db.go')
-rw-r--r-- | internal/db/db.go | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/internal/db/db.go b/internal/db/db.go index a354ddee8..cbcd698c9 100644 --- a/internal/db/db.go +++ b/internal/db/db.go @@ -160,16 +160,14 @@ type DB interface { // In case of no entries, a 'no entries' error will be returned GetFavesByAccountID(accountID string, faves *[]gtsmodel.StatusFave) error - // GetStatusesByAccountID is a shortcut for the common action of fetching a list of statuses produced by accountID. - // The given slice 'statuses' will be set to the result of the query, whatever it is. - // In case of no entries, a 'no entries' error will be returned - GetStatusesByAccountID(accountID string, statuses *[]gtsmodel.Status) error + // CountStatusesByAccountID is a shortcut for the common action of counting statuses produced by accountID. + CountStatusesByAccountID(accountID string) (int, error) // GetStatusesByTimeDescending is a shortcut for getting the most recent statuses. accountID is optional, if not provided // then all statuses will be returned. If limit is set to 0, the size of the returned slice will not be limited. This can // be very memory intensive so you probably shouldn't do this! // In case of no entries, a 'no entries' error will be returned - GetStatusesByTimeDescending(accountID string, statuses *[]gtsmodel.Status, limit int) error + GetStatusesByTimeDescending(accountID string, statuses *[]gtsmodel.Status, limit int, excludeReplies bool, maxID string, pinned bool, mediaOnly bool) error // GetLastStatusForAccountID simply gets the most recent status by the given account. // The given slice 'status' pointer will be set to the result of the query, whatever it is. @@ -251,9 +249,6 @@ type DB interface { // StatusBookmarkedBy checks if a given status has been bookmarked by a given account ID StatusBookmarkedBy(status *gtsmodel.Status, accountID string) (bool, error) - // StatusPinnedBy checks if a given status has been pinned by a given account ID - StatusPinnedBy(status *gtsmodel.Status, accountID string) (bool, error) - // FaveStatus faves the given status, using accountID as the faver. // The returned fave will be nil if the status was already faved. FaveStatus(status *gtsmodel.Status, accountID string) (*gtsmodel.StatusFave, error) |