From e323a930bff2c3a7d6b591e0bdcd092a5ed60f18 Mon Sep 17 00:00:00 2001 From: darrinsmart Date: Sat, 11 Mar 2023 02:10:58 -0800 Subject: [feature] Support multiple subscriptions on single websocket connection (#1489) - Allow Oauth authentication on websocket endpoint - Make streamType query parameter optional - Read websocket commands from client and update subscriptions --- internal/processing/stream/stream.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'internal/processing/stream/stream.go') diff --git a/internal/processing/stream/stream.go b/internal/processing/stream/stream.go index a10ab2474..f3a9e92f3 100644 --- a/internal/processing/stream/stream.go +++ b/internal/processing/stream/stream.go @@ -63,12 +63,15 @@ func (p *Processor) toAccount(payload string, event string, timelines []string, } for _, t := range timelines { - if s.Timeline == string(t) { + if _, found := s.Timelines[t]; found { s.Messages <- &stream.Message{ Stream: []string{string(t)}, Event: string(event), Payload: payload, } + // break out to the outer loop, to avoid sending duplicates + // of the same event to the same stream + break } } } -- cgit v1.2.3