summaryrefslogtreecommitdiff
path: root/internal/timeline/timeline.go
diff options
context:
space:
mode:
authorLibravatar Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com>2021-06-19 11:18:55 +0200
committerLibravatar GitHub <noreply@github.com>2021-06-19 11:18:55 +0200
commitaa8a0d08501cbb22400a67ece85c45fdfbdc6131 (patch)
tree4a4581fb8f1c9bf8cac742be15d7a57eec170a1b /internal/timeline/timeline.go
parentupdate CONTRIBUTING with css bundling instructions, and go fmt (#48) (diff)
downloadgotosocial-aa8a0d08501cbb22400a67ece85c45fdfbdc6131.tar.xz
Streaming (#49)
Add new status and notification websocket streaming capabilities
Diffstat (limited to 'internal/timeline/timeline.go')
-rw-r--r--internal/timeline/timeline.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/internal/timeline/timeline.go b/internal/timeline/timeline.go
index 363c0999c..5e274b572 100644
--- a/internal/timeline/timeline.go
+++ b/internal/timeline/timeline.go
@@ -62,7 +62,10 @@ type Timeline interface {
*/
// IndexOne puts a status into the timeline at the appropriate place according to its 'createdAt' property.
- IndexOne(statusCreatedAt time.Time, statusID string, boostOfID string) error
+ //
+ // The returned bool indicates whether or not the status was actually inserted into the timeline. This will be false
+ // if the status is a boost and the original post or another boost of it already exists < boostReinsertionDepth back in the timeline.
+ IndexOne(statusCreatedAt time.Time, statusID string, boostOfID string) (bool, error)
// OldestIndexedPostID returns the id of the rearmost (ie., the oldest) indexed post, or an error if something goes wrong.
// If nothing goes wrong but there's no oldest post, an empty string will be returned so make sure to check for this.
@@ -79,7 +82,10 @@ type Timeline interface {
PrepareBehind(statusID string, amount int) error
// IndexOne puts a status into the timeline at the appropriate place according to its 'createdAt' property,
// and then immediately prepares it.
- IndexAndPrepareOne(statusCreatedAt time.Time, statusID string) error
+ //
+ // The returned bool indicates whether or not the status was actually inserted into the timeline. This will be false
+ // if the status is a boost and the original post or another boost of it already exists < boostReinsertionDepth back in the timeline.
+ IndexAndPrepareOne(statusCreatedAt time.Time, statusID string) (bool, error)
// OldestPreparedPostID returns the id of the rearmost (ie., the oldest) prepared post, or an error if something goes wrong.
// If nothing goes wrong but there's no oldest post, an empty string will be returned so make sure to check for this.
OldestPreparedPostID() (string, error)