From cb1de17ffca862dfbce48eeff87431eb517598b9 Mon Sep 17 00:00:00 2001 From: Daniel Oaks Date: Sun, 28 Apr 2019 01:39:02 +1000 Subject: [PATCH] Omit SASL cap when auth is disabled --- irc/server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/irc/server.go b/irc/server.go index 396e8009..e4d2aadb 100644 --- a/irc/server.go +++ b/irc/server.go @@ -654,12 +654,12 @@ func (server *Server) applyConfig(config *Config, initial bool) (err error) { // SASL authPreviouslyEnabled := oldConfig != nil && oldConfig.Accounts.AuthenticationEnabled - if config.Accounts.AuthenticationEnabled && !authPreviouslyEnabled { + if config.Accounts.AuthenticationEnabled && (oldConfig == nil || !authPreviouslyEnabled) { // enabling SASL SupportedCapabilities.Enable(caps.SASL) CapValues.Set(caps.SASL, "PLAIN,EXTERNAL") addedCaps.Add(caps.SASL) - } else if !config.Accounts.AuthenticationEnabled && authPreviouslyEnabled { + } else if !config.Accounts.AuthenticationEnabled && (oldConfig == nil || authPreviouslyEnabled) { // disabling SASL SupportedCapabilities.Disable(caps.SASL) removedCaps.Add(caps.SASL)