From f17855fce9c46e5fccc0fd52defa6515ae9fab0e Mon Sep 17 00:00:00 2001 From: Jeremy Latt Date: Thu, 27 Feb 2014 18:33:03 -0800 Subject: [PATCH] check channel emptiness when anyone leaves --- irc/channel.go | 8 ++++---- irc/constants.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/irc/channel.go b/irc/channel.go index 52f18610..2b4e4d3b 100644 --- a/irc/channel.go +++ b/irc/channel.go @@ -171,10 +171,6 @@ func (channel *Channel) Part(client *Client, message string) { member.Reply(reply) } channel.Quit(client) - - if !channel.flags[Persistent] && channel.IsEmpty() { - channel.server.channels.Remove(channel) - } } func (channel *Channel) GetTopic(client *Client) { @@ -424,6 +420,10 @@ func (channel *Channel) Notice(client *Client, message string) { func (channel *Channel) Quit(client *Client) { channel.members.Remove(client) client.channels.Remove(channel) + + if !channel.flags[Persistent] && channel.IsEmpty() { + channel.server.channels.Remove(channel) + } } func (channel *Channel) Kick(client *Client, target *Client, comment string) { diff --git a/irc/constants.go b/irc/constants.go index 6ec510bb..d1904d0e 100644 --- a/irc/constants.go +++ b/irc/constants.go @@ -23,7 +23,7 @@ var ( ) const ( - SEM_VER = "ergonomadic-1.2.9" + SEM_VER = "ergonomadic-1.2.10" CRLF = "\r\n" MAX_REPLY_LEN = 512 - len(CRLF)