3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-26 13:59:44 +01:00

check channel emptiness when anyone leaves

This commit is contained in:
Jeremy Latt 2014-02-27 18:33:03 -08:00
parent 60ccddc3b7
commit f17855fce9
2 changed files with 5 additions and 5 deletions

View File

@ -171,10 +171,6 @@ func (channel *Channel) Part(client *Client, message string) {
member.Reply(reply) member.Reply(reply)
} }
channel.Quit(client) channel.Quit(client)
if !channel.flags[Persistent] && channel.IsEmpty() {
channel.server.channels.Remove(channel)
}
} }
func (channel *Channel) GetTopic(client *Client) { func (channel *Channel) GetTopic(client *Client) {
@ -424,6 +420,10 @@ func (channel *Channel) Notice(client *Client, message string) {
func (channel *Channel) Quit(client *Client) { func (channel *Channel) Quit(client *Client) {
channel.members.Remove(client) channel.members.Remove(client)
client.channels.Remove(channel) 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) { func (channel *Channel) Kick(client *Client, target *Client, comment string) {

View File

@ -23,7 +23,7 @@ var (
) )
const ( const (
SEM_VER = "ergonomadic-1.2.9" SEM_VER = "ergonomadic-1.2.10"
CRLF = "\r\n" CRLF = "\r\n"
MAX_REPLY_LEN = 512 - len(CRLF) MAX_REPLY_LEN = 512 - len(CRLF)