]> Cypherpunks.ru repositories - goircd.git/blobdiff - client.go
Add AWAY command support
[goircd.git] / client.go
index 4f48daf90be4f1f0981b96f6e30ca04fa1f438a0..1b4a9c365993abc7aa2b0f537bd98b498fe87947 100644 (file)
--- a/client.go
+++ b/client.go
@@ -31,13 +31,14 @@ const (
 )
 
 type Client struct {
-       hostname   string
+       hostname   *string
        conn       net.Conn
        registered bool
        nickname   string
        username   string
        realname   string
        password   string
+       away       *string
 }
 
 type ClientAlivenessState struct {
@@ -49,7 +50,7 @@ func (client Client) String() string {
        return client.nickname + "!" + client.username + "@" + client.conn.RemoteAddr().String()
 }
 
-func NewClient(hostname string, conn net.Conn) *Client {
+func NewClient(hostname *string, conn net.Conn) *Client {
        return &Client{hostname: hostname, conn: conn, nickname: "*", password: ""}
 }
 
@@ -89,7 +90,7 @@ func (client *Client) Msg(text string) {
 
 // Send message from server. It has ": servername" prefix.
 func (client *Client) Reply(text string) {
-       client.Msg(":" + client.hostname + " " + text)
+       client.Msg(":" + *client.hostname + " " + text)
 }
 
 // Send server message, concatenating all provided text parts and