diff options
-rw-r--r-- | clients.go | 6 | ||||
-rw-r--r-- | main.go | 2 | ||||
-rw-r--r-- | servers.go | 8 |
3 files changed, 8 insertions, 8 deletions
@@ -17,7 +17,7 @@ type Client struct { Host string Caps map[string]struct{} Extra map[string]any - Server Server + Server *Server State ClientState } @@ -40,12 +40,12 @@ func (client *Client) SendRaw(s string) error { return nil } -func (client Client) ClientSource() string { +func (client *Client) ClientSource() string { // TODO: Edge cases where these aren't available return client.Nick + "!" + client.Ident + "@" + client.Host } -func (client Client) ServerSource() string { +func (client *Client) ServerSource() string { return client.CID } @@ -16,7 +16,7 @@ func main() { setupCapls() - self = Server{ + self = &Server{ conn: nil, SID: "001", Name: "irc.runxiyu.org", @@ -16,7 +16,7 @@ func (server *Server) Send(msg SMsg) error { } func (server *Server) SendRaw(s string) error { - if server == &self { + if server == self { return ErrSendToSelf } if server.conn == nil { @@ -34,12 +34,12 @@ func (server *Server) SendRaw(s string) error { return nil } -func (server Server) ClientSource() string { +func (server *Server) ClientSource() string { return server.Name } -func (server Server) ServerSource() string { +func (server *Server) ServerSource() string { return server.SID } -var self Server +var self *Server |