File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -403,8 +403,8 @@ func (h *Handler) OnClientConnecting(
403403
404404 var channelOk bool
405405
406- isUserLimited := h .cfgContainer .IsUserLimited (ch )
407- isPrivate := h .cfgContainer .IsPrivateChannel (ch )
406+ isPrivateChannel := h .cfgContainer .IsPrivateChannel (ch )
407+ isUserLimitedChannel := h .cfgContainer .IsUserLimited (ch ) && chOpts . UserLimitedChannels
408408
409409 var userID string
410410 if credentials != nil {
@@ -416,10 +416,12 @@ func (h *Handler) OnClientConnecting(
416416 return centrifuge.ConnectReply {}, centrifuge .ErrorInternal
417417 }
418418
419- if ! isPrivate && ! chOpts .SubscribeProxyEnabled && validChannelName {
420- if isUserLimited && chOpts . UserLimitedChannels && (userID != "" && h .cfgContainer .UserAllowed (ch , userID )) {
419+ if ! isPrivateChannel && ! chOpts .SubscribeProxyEnabled && validChannelName {
420+ if isUserLimitedChannel && (userID != "" && h .cfgContainer .UserAllowed (ch , userID )) {
421421 channelOk = true
422- } else if chOpts .SubscribeForClient && (userID != "" || chOpts .SubscribeForAnonymous ) {
422+ } else if chOpts .SubscribeForClient && (userID != "" || chOpts .SubscribeForAnonymous ) && ! isUserLimitedChannel {
423+ channelOk = true
424+ } else if cfg .Client .Insecure {
423425 channelOk = true
424426 }
425427 }
You can’t perform that action at this time.
0 commit comments