From df2dfb7270cd822eb88f0c9650c684611f425754 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Mon, 18 May 2020 05:11:44 -0400 Subject: [PATCH 1/2] HistServ is a real service now, remove special casing --- irc/nickname.go | 1 - 1 file changed, 1 deletion(-) diff --git a/irc/nickname.go b/irc/nickname.go index 1adf0f55..d9b9d316 100644 --- a/irc/nickname.go +++ b/irc/nickname.go @@ -18,7 +18,6 @@ import ( var ( restrictedNicknames = []string{ "=scene=", // used for rp commands - "HistServ", // used to play back JOIN, PART, etc. to legacy clients } restrictedCasefoldedNicks = make(map[string]bool) From bced409e783ec3d4419fb8d7f6b8dc7e27e34665 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Mon, 18 May 2020 05:28:48 -0400 Subject: [PATCH 2/2] 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. --- irc/accounts.go | 12 ++++-------- irc/nickname.go | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/irc/accounts.go b/irc/accounts.go index d4ecd93c..bb33ef1e 100644 --- a/irc/accounts.go +++ b/irc/accounts.go @@ -1305,14 +1305,10 @@ func (am *AccountManager) Unregister(account string, erase bool) error { delete(am.skeletonToAccount, additionalSkel) } for _, client := range clients { - if config.Accounts.RequireSasl.Enabled { - client.Logout() - 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 - go client.destroy(nil) - } else { - am.logoutOfAccount(client) - } + client.Logout() + 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 + go client.destroy(nil) } if err != nil && !erase { diff --git a/irc/nickname.go b/irc/nickname.go index d9b9d316..bc396f79 100644 --- a/irc/nickname.go +++ b/irc/nickname.go @@ -17,7 +17,7 @@ import ( var ( restrictedNicknames = []string{ - "=scene=", // used for rp commands + "=scene=", // used for rp commands } restrictedCasefoldedNicks = make(map[string]bool)