|
@@ -834,6 +834,7 @@ func (am *AccountManager) loadRawAccount(tx *buntdb.Tx, casefoldedAccount string
|
834
|
834
|
}
|
835
|
835
|
|
836
|
836
|
func (am *AccountManager) Unregister(account string) error {
|
|
837
|
+ config := am.server.Config()
|
837
|
838
|
casefoldedAccount, err := CasefoldName(account)
|
838
|
839
|
if err != nil {
|
839
|
840
|
return errAccountDoesNotExist
|
|
@@ -906,7 +907,13 @@ func (am *AccountManager) Unregister(account string) error {
|
906
|
907
|
delete(am.skeletonToAccount, additionalSkel)
|
907
|
908
|
}
|
908
|
909
|
for _, client := range clients {
|
909
|
|
- am.logoutOfAccount(client)
|
|
910
|
+ if config.Accounts.RequireSasl.Enabled {
|
|
911
|
+ client.Quit(client.t("You are no longer authorized to be on this server"))
|
|
912
|
+ // destroy acquires a semaphore so we can't call it while holding a lock
|
|
913
|
+ go client.destroy(false)
|
|
914
|
+ } else {
|
|
915
|
+ am.logoutOfAccount(client)
|
|
916
|
+ }
|
910
|
917
|
}
|
911
|
918
|
|
912
|
919
|
if err != nil {
|