mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
Merge 385f606d67 into d5fb189a55
This commit is contained in:
commit
2e7fd883ee
1 changed files with 5 additions and 1 deletions
|
|
@ -28,10 +28,14 @@ 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) {
|
||||||
|
// 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()
|
manager.RLock()
|
||||||
defer manager.RUnlock()
|
defer manager.RUnlock()
|
||||||
for session := range manager.watchedby[cfnick] {
|
for session := range manager.watchedby[cfnick] {
|
||||||
if session.capabilities.Has(caps.ExtendedMonitor) && session.capabilities.HasAll(capabs...) {
|
if session.capabilities.HasAll(capabs...) {
|
||||||
users.Add(session)
|
users.Add(session)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue