From fdf9727600334588f7ded0d7a2235d4a7955d712 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 8 Mar 2022 21:29:04 +0100 Subject: [PATCH] Mark BouncerServ as online in MONITOR, don't forward to upstream --- downstream.go | 14 ++++++++++++++ upstream.go | 3 +++ 2 files changed, 17 insertions(+) diff --git a/downstream.go b/downstream.go index 10d6769..dea242a 100644 --- a/downstream.go +++ b/downstream.go @@ -2587,6 +2587,16 @@ func (dc *downstreamConn) handleMessageRegistered(ctx context.Context, msg *irc. dc.monitored.SetValue(target, nil) + if uc.network.casemap(target) == serviceNickCM { + // BouncerServ is never tired + dc.SendMessage(&irc.Message{ + Prefix: dc.srv.prefix(), + Command: irc.RPL_MONONLINE, + Params: []string{dc.nick, target}, + }) + continue + } + if uc.monitored.Has(target) { cmd := irc.RPL_MONOFFLINE if online := uc.monitored.Value(target); online { @@ -2632,6 +2642,10 @@ func (dc *downstreamConn) handleMessageRegistered(ctx context.Context, msg *irc. cmd = irc.RPL_MONONLINE } + if uc.network.casemap(target) == serviceNickCM { + cmd = irc.RPL_MONONLINE + } + dc.SendMessage(&irc.Message{ Prefix: dc.srv.prefix(), Command: cmd, diff --git a/upstream.go b/upstream.go index bf36dc9..9e76514 100644 --- a/upstream.go +++ b/upstream.go @@ -2135,6 +2135,9 @@ func (uc *upstreamConn) updateMonitor() { uc.forEachDownstream(func(dc *downstreamConn) { for _, entry := range dc.monitored.innerMap { targetCM := uc.network.casemap(entry.originalKey) + if targetCM == serviceNickCM { + continue + } if !uc.monitored.Has(targetCM) { if _, ok := add[targetCM]; !ok { addList = append(addList, targetCM)