Forward LUSERS and STATS messages after initial registration

This commit is contained in:
Simon Ser 2021-06-23 11:45:14 +02:00
parent faa89333bf
commit fb50d70b70

View File

@ -1455,8 +1455,14 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error {
case irc.RPL_YOURHOST, irc.RPL_CREATED: case irc.RPL_YOURHOST, irc.RPL_CREATED:
// Ignore // Ignore
case irc.RPL_LUSERCLIENT, irc.RPL_LUSEROP, irc.RPL_LUSERUNKNOWN, irc.RPL_LUSERCHANNELS, irc.RPL_LUSERME: case irc.RPL_LUSERCLIENT, irc.RPL_LUSEROP, irc.RPL_LUSERUNKNOWN, irc.RPL_LUSERCHANNELS, irc.RPL_LUSERME:
// Ignore fallthrough
case irc.RPL_STATSVLINE, rpl_statsping, irc.RPL_STATSBLINE, irc.RPL_STATSDLINE:
fallthrough
case rpl_localusers, rpl_globalusers:
fallthrough
case irc.RPL_MOTDSTART, irc.RPL_MOTD: case irc.RPL_MOTDSTART, irc.RPL_MOTD:
// Ignore these messages if they're part of the initial registration
// message burst. Forward them if the user explicitly asked for them.
if !uc.gotMotd { if !uc.gotMotd {
return nil return nil
} }
@ -1470,10 +1476,6 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error {
}) })
case irc.RPL_LISTSTART: case irc.RPL_LISTSTART:
// Ignore // Ignore
case rpl_localusers, rpl_globalusers:
// Ignore
case irc.RPL_STATSVLINE, rpl_statsping, irc.RPL_STATSBLINE, irc.RPL_STATSDLINE:
// Ignore
case "ERROR": case "ERROR":
var text string var text string
if err := parseMessageParams(msg, &text); err != nil { if err := parseMessageParams(msg, &text); err != nil {