mirror of
https://github.com/ergochat/ergo.git
synced 2024-12-22 18:52:41 +01:00
Fix whois channel handling
This commit is contained in:
parent
3a00b64830
commit
40d6cd02da
@ -629,14 +629,16 @@ func (server *Server) splitMessage(original string, origIs512 bool) SplitMessage
|
|||||||
|
|
||||||
// WhoisChannelsNames returns the common channel names between two users.
|
// WhoisChannelsNames returns the common channel names between two users.
|
||||||
func (client *Client) WhoisChannelsNames(target *Client) []string {
|
func (client *Client) WhoisChannelsNames(target *Client) []string {
|
||||||
isMultiPrefix := target.capabilities.Has(caps.MultiPrefix)
|
isMultiPrefix := client.capabilities.Has(caps.MultiPrefix)
|
||||||
var chstrs []string
|
var chstrs []string
|
||||||
for _, channel := range client.Channels() {
|
for _, channel := range target.Channels() {
|
||||||
// channel is secret and the target can't see it
|
// channel is secret and the target can't see it
|
||||||
if !target.flags[modes.Operator] && channel.HasMode(modes.Secret) && !channel.hasClient(target) {
|
if !client.flags[modes.Operator] {
|
||||||
continue
|
if (target.HasMode(modes.Invisible) || channel.HasMode(modes.Secret)) && !channel.hasClient(client) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
chstrs = append(chstrs, channel.ClientPrefixes(client, isMultiPrefix)+channel.name)
|
chstrs = append(chstrs, channel.ClientPrefixes(target, isMultiPrefix)+channel.name)
|
||||||
}
|
}
|
||||||
return chstrs
|
return chstrs
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user