Remove empty channels from the server channelMap when the last client leaves
This commit is contained in:
parent
0bc9a528ff
commit
272ea046c4
@ -124,10 +124,11 @@ func (c *Client) partChannel(channelName, reason string) {
|
|||||||
client.reply(rplPart, c.nick, channel.name, reason)
|
client.reply(rplPart, c.nick, channel.name, reason)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete(c.channelMap, channelKey)
|
||||||
delete(channel.clientMap, strings.ToLower(c.nick))
|
delete(channel.clientMap, strings.ToLower(c.nick))
|
||||||
|
|
||||||
if len(channel.clientMap) == 0 {
|
if len(channel.clientMap) == 0 {
|
||||||
delete(c.channelMap, channelKey)
|
delete(c.server.channelMap, channelKey)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user