summaryrefslogtreecommitdiff
path: root/notify.go
diff options
context:
space:
mode:
Diffstat (limited to 'notify.go')
-rw-r--r--notify.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/notify.go b/notify.go
new file mode 100644
index 0000000..9234e20
--- /dev/null
+++ b/notify.go
@@ -0,0 +1,23 @@
+package main
+
+import (
+ "log"
+
+ irc "github.com/fluffle/goirc/client"
+)
+
+type notify struct {
+ conn *irc.Conn
+ target string
+}
+
+func newNotify(conn *irc.Conn, target string) *notify {
+ return &notify{conn: conn, target: target}
+}
+
+func (n *notify) Write(p []byte) (int, error) {
+ s := limitString(p)
+ log.Println("send", s)
+ n.conn.Notice(n.target, s.String())
+ return len(p), nil
+}