Make an empty MODE b reply for faster client's sync

This commit is contained in:
Sergey Matveev 2014-08-14 17:41:57 +04:00
parent f46c678ce0
commit 4f5fa51327
2 changed files with 6 additions and 2 deletions

View File

@ -140,6 +140,10 @@ func (room *Room) Processor(events <-chan ClientEvent) {
client.Msg(fmt.Sprintf("324 %s %s %s", client.nickname, room.name, mode))
continue
}
if strings.HasPrefix(event.text, "b") {
client.ReplyNicknamed("368", room.name, "End of channel ban list")
continue
}
if strings.HasPrefix(event.text, "-k") || strings.HasPrefix(event.text, "+k") {
if _, subscribed := room.members[client]; !subscribed {
client.ReplyParts("442", room.name, "You are not on that channel")

View File

@ -198,8 +198,8 @@ func TestJoin(t *testing.T) {
t.Fatal("left #bazenc log", r)
}
conn.inbound <- "MODE #barenc +b"
if r := <-conn.outbound; r != ":foohost 472 nick2 +b :Unknown MODE flag\r\n" {
conn.inbound <- "MODE #barenc +i"
if r := <-conn.outbound; r != ":foohost 472 nick2 +i :Unknown MODE flag\r\n" {
t.Fatal("unknown MODE flag", r)
}