1
0
Fork 0
forked from External/ergo
Empty channels were only cleaned up on PART, not QUIT.
This commit is contained in:
Shivaram Lingamneni 2018-03-01 10:37:30 -05:00
parent 898fb41485
commit ef99bc48d1
2 changed files with 14 additions and 4 deletions

View file

@ -748,10 +748,15 @@ func (channel *Channel) applyModeMask(client *Client, mode modes.Mode, op modes.
func (channel *Channel) Quit(client *Client) {
channel.stateMutex.Lock()
channel.members.Remove(client)
empty := len(channel.members) == 0
channel.stateMutex.Unlock()
channel.regenerateMembersCache(false)
client.removeChannel(channel)
if empty {
client.server.channels.Cleanup(channel)
}
}
func (channel *Channel) Kick(client *Client, target *Client, comment string, rb *ResponseBuffer) {