Forward unknown commands to upstream in single-upstream mode

This commit is contained in:
Simon Ser 2021-05-28 11:15:15 +02:00
parent b0b913293e
commit 0f3dd2f2b1

View File

@ -2287,8 +2287,15 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error {
}
default:
dc.logger.Printf("unhandled message: %v", msg)
// Only forward unknown commands in single-upstream mode
uc := dc.upstream()
if uc == nil {
return newUnknownCommandError(msg.Command)
}
uc.SendMessageLabeled(dc.id, msg)
}
return nil
}