1
0
Fork 0
forked from External/ergo

Implement mode [+-]i.

This commit is contained in:
Jeremy Latt 2012-04-17 20:24:26 -07:00
parent 8f0bd1b07a
commit 99364e8b5f
7 changed files with 94 additions and 29 deletions

View file

@ -5,18 +5,19 @@ import (
)
type Client struct {
addr net.Addr
conn net.Conn
send chan<- string
recv <-chan string
username string
realname string
nick string
registered bool
invisible bool
}
func NewClient(conn net.Conn) *Client {
client := new(Client)
client.addr = conn.RemoteAddr()
client.conn = conn
client.send = StringWriteChan(conn)
client.recv = StringReadChan(conn)
return client
@ -38,3 +39,10 @@ func (c *Client) Nick() string {
}
return "<guest>"
}
func (c *Client) UModeString() string {
if c.invisible {
return "+i"
}
return ""
}