mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-30 03:52:26 -05:00
[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
This commit is contained in:
parent
cb2f84e551
commit
e323a930bf
4 changed files with 74 additions and 26 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue