mirror of
https://github.com/jeremyd/ergo.git
synced 2026-07-21 23:08:11 -07:00
Implement mode [+-]i.
This commit is contained in:
+10
-2
@@ -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 ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user