/*
goircd -- minimalistic simple Internet Relay Chat (IRC) server
-Copyright (C) 2014 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2014-2015 Sergey Matveev <stargrave@stargrave.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+
package main
import (
)
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 {
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: ""}
}
// 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