diff options
author | Dimitri Sokolyuk <demon@dim13.org> | 2016-12-25 16:45:15 +0100 |
---|---|---|
committer | Dimitri Sokolyuk <demon@dim13.org> | 2016-12-25 16:45:15 +0100 |
commit | fc1b0999a35bba9760d9d58395fb04581784c160 (patch) | |
tree | 06bcc542ff0d0361bf1624010112271896ca3d8c /main.go | |
parent | f8ad03a76772ada7dc2b46adf8d485c6c1d17e4c (diff) |
watchlist
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -5,6 +5,7 @@ import ( "fmt" "log" "strings" + "time" irc "github.com/fluffle/goirc/client" ) @@ -40,6 +41,7 @@ func kicker(conn *irc.Conn, channel string) chan string { func privmsg(note, kick chan string) irc.HandlerFunc { last := NewLast(10) links := linker(note) + wl := NewWatchList(3, 5*time.Second) return func(conn *irc.Conn, line *irc.Line) { switch t := line.Text(); { case isFlood(t): @@ -59,6 +61,7 @@ func privmsg(note, kick chan string) irc.HandlerFunc { default: links <- t last.Push(line.Time, line.Nick, t) + wl.Add(kick, line.Nick) } } } |