summaryrefslogtreecommitdiff
path: root/internal/processing/stream/stream.go
diff options
context:
space:
mode:
authorLibravatar darrinsmart <darrin@djs.to>2023-03-11 02:10:58 -0800
committerLibravatar GitHub <noreply@github.com>2023-03-11 11:10:58 +0100
commite323a930bff2c3a7d6b591e0bdcd092a5ed60f18 (patch)
treed0c1e408a908a43c256eef7a79e8909abab1b9a0 /internal/processing/stream/stream.go
parent[frontend/fix] Mobile css tweaks (#1605) (diff)
downloadgotosocial-e323a930bff2c3a7d6b591e0bdcd092a5ed60f18.tar.xz
[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
Diffstat (limited to 'internal/processing/stream/stream.go')
-rw-r--r--internal/processing/stream/stream.go5
1 files changed, 4 insertions, 1 deletions
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
}
}
}