mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
Allow multiple account registrations for testing
This commit is contained in:
parent
8e32098f1f
commit
c48d869f4d
4 changed files with 43 additions and 5 deletions
|
|
@ -262,6 +262,33 @@ func (client *Client) LoginToAccount(account *ClientAccount) {
|
|||
account.Clients = append(account.Clients, client)
|
||||
client.account = account
|
||||
client.server.snomasks.Send(sno.LocalAccounts, fmt.Sprintf(ircfmt.Unescape("Client $c[grey][$r%s$c[grey]] logged into account $c[grey][$r%s$c[grey]]"), client.nickMaskString, account.Name))
|
||||
|
||||
//TODO(dan): This should output the AccountNotify message instead of the sasl accepted function below.
|
||||
}
|
||||
|
||||
// LogoutOfAccount logs the client out of their current account.
|
||||
func (client *Client) LogoutOfAccount() {
|
||||
account := client.account
|
||||
if account == nil {
|
||||
// already logged out
|
||||
return
|
||||
}
|
||||
|
||||
// logout of existing acct
|
||||
var newClientAccounts []*Client
|
||||
for _, c := range account.Clients {
|
||||
if c != client {
|
||||
newClientAccounts = append(newClientAccounts, c)
|
||||
}
|
||||
}
|
||||
account.Clients = newClientAccounts
|
||||
|
||||
client.account = nil
|
||||
|
||||
// dispatch account-notify
|
||||
for friend := range client.Friends(AccountNotify) {
|
||||
friend.Send(nil, client.nickMaskString, "ACCOUNT", "*")
|
||||
}
|
||||
}
|
||||
|
||||
// authExternalHandler parses the SASL EXTERNAL mechanism.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue