Broadcast unhandled messages to downstream connections
In case labelled-response isn't supported, broadcast unhandled messages to all downstream connections. That's better than silently dropping the messages.
This commit is contained in:
parent
1685ba23b3
commit
51dc9f0bf9
@ -1315,7 +1315,6 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error {
|
||||
}
|
||||
}
|
||||
|
||||
if downstreamID != 0 {
|
||||
uc.forEachDownstreamByID(downstreamID, func(dc *downstreamConn) {
|
||||
dc.SendMessage(&irc.Message{
|
||||
Prefix: uc.srv.prefix(),
|
||||
@ -1323,7 +1322,6 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error {
|
||||
Params: []string{dc.nick, command, reason},
|
||||
})
|
||||
})
|
||||
}
|
||||
case "ACK":
|
||||
// Ignore
|
||||
case irc.RPL_NOWAWAY, irc.RPL_UNAWAY:
|
||||
@ -1347,7 +1345,7 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error {
|
||||
fallthrough
|
||||
default:
|
||||
uc.logger.Printf("unhandled message: %v", msg)
|
||||
if downstreamID != 0 {
|
||||
|
||||
uc.forEachDownstreamByID(downstreamID, func(dc *downstreamConn) {
|
||||
// best effort marshaling for unknown messages, replies and errors:
|
||||
// most numerics start with the user nick, marshal it if that's the case
|
||||
@ -1365,7 +1363,6 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error {
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user