forked from External/ergo
Implement nick changing.
This commit is contained in:
parent
99364e8b5f
commit
e7734f572b
4 changed files with 34 additions and 6 deletions
|
|
@ -2,6 +2,7 @@ package irc
|
|||
|
||||
import (
|
||||
"net"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type Client struct {
|
||||
|
|
@ -46,3 +47,20 @@ func (c *Client) UModeString() string {
|
|||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (c *Client) HasNick() bool {
|
||||
return c.nick != ""
|
||||
}
|
||||
|
||||
func (c *Client) HasUser() bool {
|
||||
return c.username != ""
|
||||
}
|
||||
|
||||
func (c *Client) Hostname() string {
|
||||
addr := c.conn.RemoteAddr().String()
|
||||
index := strings.LastIndex(addr, ":")
|
||||
if index != -1 {
|
||||
return addr[0:index]
|
||||
}
|
||||
return addr
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue