From e3abae44a797703e508ce1eacd21427ed576b3aa Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 11 Feb 2025 11:44:05 +0000 Subject: [PATCH] Make email confirmation a bit smarter. --- data/nickserv.example.conf | 5 ++++- modules/nickserv/ns_set.cpp | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/data/nickserv.example.conf b/data/nickserv.example.conf index 9c46979a7..ad41ba37f 100644 --- a/data/nickserv.example.conf +++ b/data/nickserv.example.conf @@ -86,8 +86,11 @@ module /* * Require users who change their email address to confirm they * own their new email. + * + * If {ns_register}:registration is set to mail then this defaults + * to yes. Otherwise, it defaults to no. */ - confirmemailchanges = no + #confirmemailchanges = yes /* * A message sent to users on connect if they use an unregistered nick. %n will be replaced with the user's nickname. diff --git a/modules/nickserv/ns_set.cpp b/modules/nickserv/ns_set.cpp index ec01dc00b..a1291fe26 100644 --- a/modules/nickserv/ns_set.cpp +++ b/modules/nickserv/ns_set.cpp @@ -598,7 +598,8 @@ public: if (MOD_RESULT == EVENT_STOP) return; - if (!param.empty() && Config->GetModule("nickserv")->Get("confirmemailchanges") && !source.IsServicesOper()) + const auto nsmailreg = Config->GetModule("ns_register")->Get("registration").equals_ci("mail"); + if (!param.empty() && Config->GetModule("nickserv")->Get("confirmemailchanges", nsmailreg ? "yes" : "no") && !source.IsServicesOper()) { if (SendConfirmMail(source.GetUser(), source.GetAccount(), source.service, param)) {