From b1a5a474809084465f5d6e2dfad75cbbafb5281a Mon Sep 17 00:00:00 2001 From: William Rehwinkel <49931356+FiskFan1999@users.noreply.github.com> Date: Mon, 28 Feb 2022 20:31:16 -0500 Subject: [PATCH] Fix #1911 +s channels don't appear in /list even though on the channel (#1923) * Fix #1911 +s channels don't appear in /list even though on the channel * use channel.HasClient instead of custom iterative checker --- irc/handlers.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/irc/handlers.go b/irc/handlers.go index ecc55119..deadf943 100644 --- a/irc/handlers.go +++ b/irc/handlers.go @@ -1633,7 +1633,7 @@ func listHandler(server *Server, client *Client, msg ircmsg.Message, rb *Respons clientIsOp := client.HasRoleCapabs("sajoin") if len(channels) == 0 { for _, channel := range server.channels.Channels() { - if !clientIsOp && channel.flags.HasMode(modes.Secret) { + if !clientIsOp && channel.flags.HasMode(modes.Secret) && !channel.hasClient(client) { continue } if matcher.Matches(channel) { @@ -1648,7 +1648,7 @@ func listHandler(server *Server, client *Client, msg ircmsg.Message, rb *Respons for _, chname := range channels { channel := server.channels.Get(chname) - if channel == nil || (!clientIsOp && channel.flags.HasMode(modes.Secret)) { + if channel == nil || (!clientIsOp && channel.flags.HasMode(modes.Secret) && !channel.hasClient(client)) { if len(chname) > 0 { rb.Add(nil, server.name, ERR_NOSUCHCHANNEL, client.nick, utils.SafeErrorParam(chname), client.t("No such channel")) }