Support cap-notify and enabling/disabling SASL

This commit is contained in:
Daniel Oaks 2016-10-22 22:18:41 +10:00
parent 1f2cfbee6f
commit b84dbb1a06
7 changed files with 88 additions and 17 deletions

View file

@ -82,6 +82,24 @@ func (clients *ClientLookupSet) Remove(client *Client) error {
return nil
}
func (clients *ClientLookupSet) AllWithCaps(caps ...Capability) (set ClientSet) {
set = make(ClientSet)
var client *Client
for _, client = range clients.ByNick {
// make sure they have all the required caps
for _, Cap := range caps {
if !client.capabilities[Cap] {
continue
}
}
set.Add(client)
}
return set
}
func (clients *ClientLookupSet) FindAll(userhost string) (set ClientSet) {
set = make(ClientSet)