From 4f5fa5132780b50c7f2b51329b2a68d3cbbff939 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Thu, 14 Aug 2014 17:41:57 +0400 Subject: [PATCH] Make an empty MODE b reply for faster client's sync --- room.go | 4 ++++ room_test.go | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/room.go b/room.go index eeff4d0..ccfdb07 100644 --- a/room.go +++ b/room.go @@ -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") diff --git a/room_test.go b/room_test.go index 0ad2cac..6bd1cb0 100644 --- a/room_test.go +++ b/room_test.go @@ -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) }