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