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

Merge pull request #1256 from slingamn/deadcode

remove dead code
This commit is contained in:
Shivaram Lingamneni 2020-09-03 21:19:34 -07:00 committed by GitHub
commit 1c110fa501
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)