[feature] Add List functionality (#1802)

* start working on lists

* further list work

* test list db functions nicely

* more work on lists

* peepoopeepoo

* poke

* start list timeline func

* we're getting there lads

* couldn't be me working on stuff... could it?

* hook up handlers

* fiddling

* weeee

* woah

* screaming, pissing

* fix streaming being a whiny baby

* lint, small test fix, swagger

* tidying up, testing

* fucked! by the linter

* move timelines to state like a boss

* add timeline start to tests using state

* invalidate lists
This commit is contained in:
tobi
2023-05-25 10:37:38 +02:00
committed by GitHub
parent 282be6f26d
commit f5c004d67d
123 changed files with 5654 additions and 970 deletions

View File

@@ -39,6 +39,8 @@ const (
TimelineNotifications string = "user:notification"
// TimelineDirect -- statuses sent to a user directly.
TimelineDirect string = "direct"
// TimelineList -- statuses for a user's list timeline.
TimelineList string = "list"
)
// AllStatusTimelines contains all Timelines that a status could conceivably be delivered to -- useful for doing deletes.
@@ -47,6 +49,7 @@ var AllStatusTimelines = []string{
TimelinePublic,
TimelineHome,
TimelineDirect,
TimelineList,
}
// StreamsForAccount is a wrapper for the multiple streams that one account can have running at the same time.
@@ -62,10 +65,9 @@ type StreamsForAccount struct {
type Stream struct {
// ID of this stream, generated during creation.
ID string
// A set of timelines of this stream: user/public/etc
// a matching key means the timeline is subscribed. The value
// is ignored
Timelines map[string]bool
// A set of types subscribed to by this stream: user/public/etc.
// It's a map to ensure no duplicates; the value is ignored.
StreamTypes map[string]any
// Channel of messages for the client to read from
Messages chan *Message
// Channel to close when the client drops away