summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-12-25 16:45:15 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-12-25 16:45:15 +0100
commitfc1b0999a35bba9760d9d58395fb04581784c160 (patch)
tree06bcc542ff0d0361bf1624010112271896ca3d8c /main.go
parentf8ad03a76772ada7dc2b46adf8d485c6c1d17e4c (diff)
watchlist
Diffstat (limited to 'main.go')
-rw-r--r--main.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/main.go b/main.go
index e2fd650..c884fe5 100644
--- a/main.go
+++ b/main.go
@@ -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)
}
}
}