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,28 +28,18 @@ 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) {
|
||||
var requireExtendedMonitor bool
|
||||
for _, c := range capabs {
|
||||
// these are the four capabilities that explicitly require extended-monitor;
|
||||
// draft/metadata-2 does not
|
||||
if c == caps.AccountNotify || c == caps.AwayNotify || c == caps.ChgHost || c == caps.SetName {
|
||||
requireExtendedMonitor = true
|
||||
break
|
||||
}
|
||||
}
|
||||
// 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 requireExtendedMonitor && !session.capabilities.Has(caps.ExtendedMonitor) {
|
||||
continue
|
||||
}
|
||||
if !session.capabilities.HasAll(capabs...) {
|
||||
continue
|
||||
}
|
||||
if session.capabilities.HasAll(capabs...) {
|
||||
users.Add(session)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// AlertAbout alerts everyone monitoring `client`'s nick that `client` is now {on,off}line.
|
||||
func (manager *MonitorManager) AlertAbout(nick, cfnick string, online bool, client *Client) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue