forked from External/ergo
Implement mode [+-]i.
This commit is contained in:
parent
8f0bd1b07a
commit
99364e8b5f
7 changed files with 94 additions and 29 deletions
|
|
@ -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 ""
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue