mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-22 20:09:41 +01:00
check channel emptiness when anyone leaves
This commit is contained in:
parent
60ccddc3b7
commit
f17855fce9
@ -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) {
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user