From 3c4c5dde4defd55eb2c25906867b109a0558d289 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Mon, 22 Dec 2025 03:25:27 -0500 Subject: [PATCH] fix #2309 (#2310) If bob is monitoring alice, bob should get METADATA lines for alice even if bob doesn't have extended-monitor. This implementation also removes the check for extended-monitor when sending account-notify, away-notify, chghost, setname (which are explicitly mentioned in the extended-monitor spec) on the grounds that nothing bad will happen if clients who support the cap receive notifications for users they're not explicitly tracking. --- irc/monitor.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/irc/monitor.go b/irc/monitor.go index 46ab46e6..7019f64a 100644 --- a/irc/monitor.go +++ b/irc/monitor.go @@ -28,10 +28,14 @@ func (mm *MonitorManager) Initialize() { // AddMonitors adds clients using extended-monitor monitoring `client`'s nick to the passed user set. func (manager *MonitorManager) AddMonitors(users utils.HashSet[*Session], cfnick string, capabs ...caps.Capability) { + // technically, we should check extended-monitor here, but it's not really necessary + // since clients will ignore AWAY, ACCOUNT, CHGHOST, and SETNAME for users + // they're not tracking + manager.RLock() defer manager.RUnlock() for session := range manager.watchedby[cfnick] { - if session.capabilities.Has(caps.ExtendedMonitor) && session.capabilities.HasAll(capabs...) { + if session.capabilities.HasAll(capabs...) { users.Add(session) } }