From ecdc1a7bb7e2cf1d58e5c7838a716b9e105dbc63 Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Mon, 18 Feb 2013 14:08:08 -0500 Subject: [PATCH] Adding support for QUIT --- main.go | 4 ++++ plugins/downtime.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 242335f..756fbd1 100644 --- a/main.go +++ b/main.go @@ -71,6 +71,10 @@ func main() { b.ActionRecieved(conn, line) }) + c.AddHandler("QUIT", func(conn *irc.Conn, line *irc.Line) { + b.ActionRecieved(conn, line) + }) + c.AddHandler("JOIN", func(conn *irc.Conn, line *irc.Line) { b.ActionRecieved(conn, line) }) diff --git a/plugins/downtime.go b/plugins/downtime.go index c6ffa57..229898e 100644 --- a/plugins/downtime.go +++ b/plugins/downtime.go @@ -140,7 +140,7 @@ func (p *DowntimePlugin) Event(kind string, message bot.Message) bool { } else { p.record(strings.ToLower(message.User.Name)) } - } else if kind == "PART" { + } else if kind == "PART" || kind == "QUIT" { p.remove(strings.ToLower(message.User.Name)) } else { log.Println("Unknown event: ", kind, message.User, message)