Mark BouncerServ as online in MONITOR, don't forward to upstream

This commit is contained in:
Simon Ser 2022-03-08 21:29:04 +01:00
parent d8f5f8481f
commit fdf9727600
2 changed files with 17 additions and 0 deletions

View File

@ -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,

View File

@ -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)