diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 678464d..91a2d26 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -1,6 +1,6 @@ { "ImportPath": "github.com/tslocum/AnonIRCd", - "GoVersion": "go1.7", + "GoVersion": "go1.8", "GodepVersion": "v79", "Deps": [ { diff --git a/README.md b/README.md index 3a8bfbe..606cd36 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ -AnonIRCd --------- +# AnonIRCd -#### Try it out! +AnonIRCd is an anonymous IRC daemon. All messages appear to be written by **Anonymous**. + +#### Try AnonIRCd by joining AnonIRC Connect to [**z.1chan.us:6667**](irc://z.1chan.us:6667) or [**:6697 (SSL)**](ircs://z.1chan.us:6697). diff --git a/anonircd.go b/anonircd.go index 7cbf20d..3049159 100644 --- a/anonircd.go +++ b/anonircd.go @@ -1,5 +1,5 @@ -// AnonIRCd -// https://github.com/tslocum/anonircd +// AnonIRCd - Anonymous IRC daemon +// https://github.com/tslocum/AnonIRCd // Written by Trevor 'tee' Slocum // // This program is free software: you can redistribute it and/or modify diff --git a/server.go b/server.go index 1382736..1f4d578 100644 --- a/server.go +++ b/server.go @@ -10,13 +10,14 @@ import ( "time" "crypto/tls" - "github.com/BurntSushi/toml" - cmap "github.com/orcaman/concurrent-map" - irc "gopkg.in/sorcix/irc.v2" "math/rand" "net/http" "os" "reflect" + + "github.com/BurntSushi/toml" + cmap "github.com/orcaman/concurrent-map" + irc "gopkg.in/sorcix/irc.v2" ) type Config struct { @@ -474,6 +475,12 @@ func (s *Server) handleRead(c *Client) { } s.joinChannel("#", c.identifier) + } else if msg.Command == irc.AWAY { + if len(msg.Params) > 0 { + c.write(&irc.Message{&anonirc, irc.RPL_NOWAWAY, []string{"You have been marked as being away"}}) + } else { + c.write(&irc.Message{&anonirc, irc.RPL_UNAWAY, []string{"You are no longer marked as being away"}}) + } } else if msg.Command == irc.LIST { chans := make(map[string]int) for chs := range s.channels.IterBuffered() {