From f37aedea796f54e1b2c23a7d43a685af27258114 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 14 Jul 2022 15:51:26 +0200 Subject: [PATCH] downstream: reply to INFO --- downstream.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/downstream.go b/downstream.go index 9c70029..107d41e 100644 --- a/downstream.go +++ b/downstream.go @@ -2696,6 +2696,27 @@ func (dc *downstreamConn) handleMessageRegistered(ctx context.Context, msg *irc. if uc != nil { uc.updateAway() } + case "INFO": + if dc.network == nil { + dc.SendMessage(&irc.Message{ + Command: irc.RPL_INFO, + Params: []string{dc.nick, "soju "}, + }) + dc.SendMessage(&irc.Message{ + Command: irc.RPL_ENDOFINFO, + Params: []string{dc.nick, "End of INFO"}, + }) + break + } + + if uc := dc.upstream(); uc == nil { + return ircError{&irc.Message{ + Command: irc.ERR_UNKNOWNCOMMAND, + Params: []string{dc.nick, msg.Command, "Disconnected from upstream network"}, + }} + } else { + uc.SendMessageLabeled(ctx, dc.id, msg) + } case "MONITOR": // MONITOR is unsupported in multi-upstream mode uc := dc.upstream()