forked from External/ergo
unconditionally destroy the client on unregister
This avoids conditions where two sessions can be attached to the same client while not logged into an account.
This commit is contained in:
parent
df2dfb7270
commit
bced409e78
2 changed files with 5 additions and 9 deletions
|
|
@ -1305,14 +1305,10 @@ func (am *AccountManager) Unregister(account string, erase bool) error {
|
||||||
delete(am.skeletonToAccount, additionalSkel)
|
delete(am.skeletonToAccount, additionalSkel)
|
||||||
}
|
}
|
||||||
for _, client := range clients {
|
for _, client := range clients {
|
||||||
if config.Accounts.RequireSasl.Enabled {
|
client.Logout()
|
||||||
client.Logout()
|
client.Quit(client.t("You are no longer authorized to be on this server"), nil)
|
||||||
client.Quit(client.t("You are no longer authorized to be on this server"), nil)
|
// destroy acquires a semaphore so we can't call it while holding a lock
|
||||||
// destroy acquires a semaphore so we can't call it while holding a lock
|
go client.destroy(nil)
|
||||||
go client.destroy(nil)
|
|
||||||
} else {
|
|
||||||
am.logoutOfAccount(client)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil && !erase {
|
if err != nil && !erase {
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import (
|
||||||
|
|
||||||
var (
|
var (
|
||||||
restrictedNicknames = []string{
|
restrictedNicknames = []string{
|
||||||
"=scene=", // used for rp commands
|
"=scene=", // used for rp commands
|
||||||
}
|
}
|
||||||
|
|
||||||
restrictedCasefoldedNicks = make(map[string]bool)
|
restrictedCasefoldedNicks = make(map[string]bool)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue