summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2025-02-11 11:44:05 +0000
committerSadie Powell <sadie@witchery.services>2025-02-11 11:57:34 +0000
commite3abae44a797703e508ce1eacd21427ed576b3aa (patch)
tree1d8a2aa64d9eb7d7739903f882a2504aa53f56bd
parenta8be208da166d092ecfd094be6068413905e6c1a (diff)
Make email confirmation a bit smarter.
-rw-r--r--data/nickserv.example.conf5
-rw-r--r--modules/nickserv/ns_set.cpp3
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<bool>("confirmemailchanges") && !source.IsServicesOper())
+ const auto nsmailreg = Config->GetModule("ns_register")->Get<const Anope::string>("registration").equals_ci("mail");
+ if (!param.empty() && Config->GetModule("nickserv")->Get<bool>("confirmemailchanges", nsmailreg ? "yes" : "no") && !source.IsServicesOper())
{
if (SendConfirmMail(source.GetUser(), source.GetAccount(), source.service, param))
{