From f5c004d67d4ed66b6c6df100afec47174aa14ae0 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Thu, 25 May 2023 10:37:38 +0200 Subject: [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 --- internal/stream/stream.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'internal/stream/stream.go') diff --git a/internal/stream/stream.go b/internal/stream/stream.go index a5b5bd38b..ae815e029 100644 --- a/internal/stream/stream.go +++ b/internal/stream/stream.go @@ -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 -- cgit v1.2.3