X-Git-Url: http://www.git.cypherpunks.ru/?p=goircd.git;a=blobdiff_plain;f=client.go;h=3637d499da5e245990241eaffb0efad337214600;hp=4f48daf90be4f1f0981b96f6e30ca04fa1f438a0;hb=990937d451208b0299246c46dd29adf7a35f97ee;hpb=85e6538f2f610ad66bf0be0eff5bdcf05f1b8e3c diff --git a/client.go b/client.go index 4f48daf..3637d49 100644 --- a/client.go +++ b/client.go @@ -31,7 +31,7 @@ const ( ) type Client struct { - hostname string + hostname *string conn net.Conn registered bool nickname string @@ -49,7 +49,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 +89,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