Forward channel information
This commit is contained in:
parent
4a816e1593
commit
cd7556264e
@ -73,6 +73,14 @@ func newDownstreamConn(srv *Server, netConn net.Conn) *downstreamConn {
|
||||
return conn
|
||||
}
|
||||
|
||||
func (c *downstreamConn) prefix() *irc.Prefix {
|
||||
return &irc.Prefix{
|
||||
Name: c.nick,
|
||||
User: c.username,
|
||||
// TODO: fill the host?
|
||||
}
|
||||
}
|
||||
|
||||
func (c *downstreamConn) readMessages() error {
|
||||
c.logger.Printf("new connection")
|
||||
defer c.Close()
|
||||
|
@ -168,6 +168,12 @@ func (c *upstreamConn) handleMessage(msg *irc.Message) error {
|
||||
}
|
||||
|
||||
ch.complete = true
|
||||
|
||||
c.srv.lock.Lock()
|
||||
for _, dc := range c.srv.downstreamConns {
|
||||
forwardChannel(dc, ch)
|
||||
}
|
||||
c.srv.lock.Unlock()
|
||||
case irc.RPL_YOURHOST, irc.RPL_CREATED:
|
||||
// Ignore
|
||||
case irc.RPL_LUSERCLIENT, irc.RPL_LUSEROP, irc.RPL_LUSERUNKNOWN, irc.RPL_LUSERCHANNELS, irc.RPL_LUSERME:
|
||||
|
Loading…
Reference in New Issue
Block a user