3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-29 23:49:25 +01:00

remove dead code

This commit is contained in:
Shivaram Lingamneni 2020-09-03 18:37:18 -04:00
parent 812414189b
commit ed8de2a77a

View File

@ -28,14 +28,6 @@ func (clients *ClientManager) Initialize() {
clients.bySkeleton = make(map[string]*Client) clients.bySkeleton = make(map[string]*Client)
} }
// Count returns how many clients are in the manager.
func (clients *ClientManager) Count() int {
clients.RLock()
defer clients.RUnlock()
count := len(clients.byNick)
return count
}
// Get retrieves a client from the manager, if they exist. // Get retrieves a client from the manager, if they exist.
func (clients *ClientManager) Get(nick string) *Client { func (clients *ClientManager) Get(nick string) *Client {
casefoldedName, err := CasefoldName(nick) casefoldedName, err := CasefoldName(nick)
@ -262,21 +254,6 @@ func (clients *ClientManager) AllClients() (result []*Client) {
return return
} }
// AllWithCaps returns all clients with the given capabilities.
func (clients *ClientManager) AllWithCaps(capabs ...caps.Capability) (sessions []*Session) {
clients.RLock()
defer clients.RUnlock()
for _, client := range clients.byNick {
for _, session := range client.Sessions() {
if session.capabilities.HasAll(capabs...) {
sessions = append(sessions, session)
}
}
}
return
}
// AllWithCapsNotify returns all clients with the given capabilities, and that support cap-notify. // AllWithCapsNotify returns all clients with the given capabilities, and that support cap-notify.
func (clients *ClientManager) AllWithCapsNotify(capabs ...caps.Capability) (sessions []*Session) { func (clients *ClientManager) AllWithCapsNotify(capabs ...caps.Capability) (sessions []*Session) {
capabs = append(capabs, caps.CapNotify) capabs = append(capabs, caps.CapNotify)