summaryrefslogtreecommitdiff
path: root/last.go
diff options
context:
space:
mode:
Diffstat (limited to 'last.go')
-rw-r--r--last.go37
1 files changed, 0 insertions, 37 deletions
diff --git a/last.go b/last.go
deleted file mode 100644
index 8cf12fa..0000000
--- a/last.go
+++ /dev/null
@@ -1,37 +0,0 @@
-package main
-
-import (
- "container/ring"
- "fmt"
-
- irc "github.com/fluffle/goirc/client"
-)
-
-type Last struct{}
-
-var buffer = ring.New(10)
-
-func (Last) Handle(conn *irc.Conn, line *irc.Line) {
- buffer.Do(func(v interface{}) {
- if v != nil {
- l := v.(*irc.Line)
- s := fmt.Sprintf("%v <%v> %v",
- l.Time.UTC().Format("15:04 UTC"),
- l.Nick, l.Text())
- conn.Notice(line.Nick, s)
- }
- })
-}
-
-func (Last) String() string {
- return "Return last 10 messages"
-}
-
-func Push(line *irc.Line) {
- buffer.Value = line
- buffer = buffer.Next()
-}
-
-func init() {
- Register("last", &Last{})
-}