Browse Source

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 years ago
parent
commit
bced409e78
2 changed files with 5 additions and 9 deletions
  1. 4
    8
      irc/accounts.go
  2. 1
    1
      irc/nickname.go

+ 4
- 8
irc/accounts.go View File

1305
 		delete(am.skeletonToAccount, additionalSkel)
1305
 		delete(am.skeletonToAccount, additionalSkel)
1306
 	}
1306
 	}
1307
 	for _, client := range clients {
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
 	if err != nil && !erase {
1314
 	if err != nil && !erase {

+ 1
- 1
irc/nickname.go View File

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

Loading…
Cancel
Save