3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-22 10:42:52 +01:00
Partially fixed earlier in #467
This commit is contained in:
Shivaram Lingamneni 2019-05-29 14:24:23 -04:00
parent 6b51bd6f15
commit 521d5bf50f
2 changed files with 9 additions and 6 deletions

View File

@ -476,7 +476,7 @@ To unset this mode:
### +s - Secret ### +s - Secret
If this mode is set, it means that your channel should be marked as 'secret'. Your channel won't show up in `/LIST` or `/WHOIS`. If this mode is set, it means that your channel should be marked as 'secret'. Your channel won't show up in `/LIST` or `/WHOIS`, and non-members won't be able to see its members with `/NAMES` or `/WHO`.
To set this mode: To set this mode:

View File

@ -1954,17 +1954,20 @@ func namesHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Res
// TODO: in a post-federation world, process `target` (server to forward request to) // TODO: in a post-federation world, process `target` (server to forward request to)
if len(channels) == 0 { if len(channels) == 0 {
for _, channel := range server.channels.Channels() { rb.Add(nil, server.name, RPL_ENDOFNAMES, client.Nick(), "*", client.t("End of NAMES list"))
channel.Names(client, rb)
}
return false return false
} }
for _, chname := range channels { for _, chname := range channels {
success := false
channel := server.channels.Get(chname) channel := server.channels.Get(chname)
if channel != nil { if channel != nil {
channel.Names(client, rb) if !channel.flags.HasMode(modes.Secret) || channel.hasClient(client) || client.HasMode(modes.Operator) {
} else if chname != "" { channel.Names(client, rb)
success = true
}
}
if !success { // channel.Names() sends this numeric itself on success
rb.Add(nil, server.name, RPL_ENDOFNAMES, client.Nick(), chname, client.t("End of NAMES list")) rb.Add(nil, server.name, RPL_ENDOFNAMES, client.Nick(), chname, client.t("End of NAMES list"))
} }
} }