Browse Source

Add AWAY support and update README, fixes #22

master
Trevor Slocum 6 years ago
parent
commit
bba2aff2cd
  1. 2
      Godeps/Godeps.json
  2. 7
      README.md
  3. 4
      anonircd.go
  4. 13
      server.go

2
Godeps/Godeps.json generated vendored

@ -1,6 +1,6 @@
{
"ImportPath": "github.com/tslocum/AnonIRCd",
"GoVersion": "go1.7",
"GoVersion": "go1.8",
"GodepVersion": "v79",
"Deps": [
{

7
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).

4
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 <tslocum@gmail.com>
//
// This program is free software: you can redistribute it and/or modify

13
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() {

Loading…
Cancel
Save