Ver código fonte

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.
tags/v2.1.0-rc1
Shivaram Lingamneni 4 anos atrás
pai
commit
bced409e78
2 arquivos alterados com 5 adições e 9 exclusões
  1. 4
    8
      irc/accounts.go
  2. 1
    1
      irc/nickname.go

+ 4
- 8
irc/accounts.go Ver arquivo

@@ -1305,14 +1305,10 @@ func (am *AccountManager) Unregister(account string, erase bool) error {
1305 1305
 		delete(am.skeletonToAccount, additionalSkel)
1306 1306
 	}
1307 1307
 	for _, client := range clients {
1308
-		if config.Accounts.RequireSasl.Enabled {
1309
-			client.Logout()
1310
-			client.Quit(client.t("You are no longer authorized to be on this server"), nil)
1311
-			// destroy acquires a semaphore so we can't call it while holding a lock
1312
-			go client.destroy(nil)
1313
-		} else {
1314
-			am.logoutOfAccount(client)
1315
-		}
1308
+		client.Logout()
1309
+		client.Quit(client.t("You are no longer authorized to be on this server"), nil)
1310
+		// destroy acquires a semaphore so we can't call it while holding a lock
1311
+		go client.destroy(nil)
1316 1312
 	}
1317 1313
 
1318 1314
 	if err != nil && !erase {

+ 1
- 1
irc/nickname.go Ver arquivo

@@ -17,7 +17,7 @@ import (
17 17
 
18 18
 var (
19 19
 	restrictedNicknames = []string{
20
-		"=scene=",  // used for rp commands
20
+		"=scene=", // used for rp commands
21 21
 	}
22 22
 
23 23
 	restrictedCasefoldedNicks = make(map[string]bool)

Carregando…
Cancelar
Salvar