mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
don't check extended-monitor
This commit is contained in:
parent
eda5c01b2d
commit
385f606d67
1 changed files with 5 additions and 15 deletions
|
|
@ -28,26 +28,16 @@ func (mm *MonitorManager) Initialize() {
|
||||||
|
|
||||||
// AddMonitors adds clients using extended-monitor monitoring `client`'s nick to the passed user set.
|
// 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) {
|
func (manager *MonitorManager) AddMonitors(users utils.HashSet[*Session], cfnick string, capabs ...caps.Capability) {
|
||||||
var requireExtendedMonitor bool
|
// technically, we should check extended-monitor here, but it's not really necessary
|
||||||
for _, c := range capabs {
|
// since clients will ignore AWAY, ACCOUNT, CHGHOST, and SETNAME for users
|
||||||
// these are the four capabilities that explicitly require extended-monitor;
|
// they're not tracking
|
||||||
// draft/metadata-2 does not
|
|
||||||
if c == caps.AccountNotify || c == caps.AwayNotify || c == caps.ChgHost || c == caps.SetName {
|
|
||||||
requireExtendedMonitor = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
manager.RLock()
|
manager.RLock()
|
||||||
defer manager.RUnlock()
|
defer manager.RUnlock()
|
||||||
for session := range manager.watchedby[cfnick] {
|
for session := range manager.watchedby[cfnick] {
|
||||||
if requireExtendedMonitor && !session.capabilities.Has(caps.ExtendedMonitor) {
|
if session.capabilities.HasAll(capabs...) {
|
||||||
continue
|
users.Add(session)
|
||||||
}
|
}
|
||||||
if !session.capabilities.HasAll(capabs...) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
users.Add(session)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue