Add ChanServ and NickServ LIST commands.

These commands search the registered nicknames/channels for ones
matching the provided regex, or return the entire list.

Only operators with chanreg (for ChanServ) or accreg (for NickServ)
capabilities can use LIST.
This commit is contained in:
Alex Jaspersen 2020-05-04 00:51:39 +00:00
parent 11e1939c9b
commit 6019ed1e29
3 changed files with 90 additions and 0 deletions

View file

@ -1047,6 +1047,17 @@ func (am *AccountManager) AuthenticateByPassphrase(client *Client, accountName s
return err
}
func (am *AccountManager) AllNicks() []string {
am.RLock()
defer am.RUnlock()
nicks := make([]string, 0, len(am.nickToAccount))
for nick := range am.nickToAccount {
nicks = append(nicks, nick)
}
return nicks
}
func (am *AccountManager) LoadAccount(accountName string) (result ClientAccount, err error) {
casefoldedAccount, err := CasefoldName(accountName)
if err != nil {