Add upstreamConn.register
This commit is contained in:
parent
96653499dc
commit
e17c0b3aca
@ -106,6 +106,8 @@ func (s *Server) Run() {
|
||||
return
|
||||
}
|
||||
|
||||
conn.register()
|
||||
|
||||
u.lock.Lock()
|
||||
u.upstreamConns = append(u.upstreamConns, conn)
|
||||
u.lock.Unlock()
|
||||
|
@ -317,9 +317,7 @@ func (c *upstreamConn) handleMessage(msg *irc.Message) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *upstreamConn) readMessages() error {
|
||||
defer c.Close()
|
||||
|
||||
func (c *upstreamConn) register() {
|
||||
c.nick = c.upstream.Nick
|
||||
c.messages <- &irc.Message{
|
||||
Command: "NICK",
|
||||
@ -329,6 +327,10 @@ func (c *upstreamConn) readMessages() error {
|
||||
Command: "USER",
|
||||
Params: []string{c.upstream.Username, "0", "*", c.upstream.Realname},
|
||||
}
|
||||
}
|
||||
|
||||
func (c *upstreamConn) readMessages() error {
|
||||
defer c.Close()
|
||||
|
||||
for {
|
||||
msg, err := c.irc.ReadMessage()
|
||||
|
Loading…
Reference in New Issue
Block a user