Use visitor instead of UserID in topicSubscription

This commit is contained in:
Karmanyaah Malhotra 2023-02-14 13:07:32 -06:00
parent cc309e87e9
commit d686e1ee77
2 changed files with 9 additions and 8 deletions

View file

@ -1023,7 +1023,7 @@ func (s *Server) handleSubscribeHTTP(w http.ResponseWriter, r *http.Request, v *
defer cancel()
subscriberIDs := make([]int, 0)
for _, t := range topics {
subscriberIDs = append(subscriberIDs, t.Subscribe(sub, v.MaybeUserID(), cancel))
subscriberIDs = append(subscriberIDs, t.Subscribe(sub, v, cancel))
}
defer func() {
for i, subscriberID := range subscriberIDs {
@ -1155,7 +1155,7 @@ func (s *Server) handleSubscribeWS(w http.ResponseWriter, r *http.Request, v *vi
}
subscriberIDs := make([]int, 0)
for _, t := range topics {
subscriberIDs = append(subscriberIDs, t.Subscribe(sub, v.MaybeUserID(), cancel))
subscriberIDs = append(subscriberIDs, t.Subscribe(sub, v, cancel))
}
defer func() {
for i, subscriberID := range subscriberIDs {