From bf727285bcf7c7c95c2b2b43faa3d1fa13bad6fb Mon Sep 17 00:00:00 2001 From: Peter Tseng Date: Sun, 1 Feb 2015 13:43:42 +0000 Subject: [PATCH] SendConfirmMail: Replace %E with new email The old mailer message said the user is changing email "to %e", which is changing TO the OLD email. But instead, the user is actually changing the email to the new email. We could change %e to be the new email, but maybe some users of Anope have already configured their messages to assume %e is the old email. So instead, add a new %E that is replaced with the new email. --- data/example.conf | 2 +- modules/commands/ns_set.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/data/example.conf b/data/example.conf index 0db803f62..a85e4df5e 100644 --- a/data/example.conf +++ b/data/example.conf @@ -1018,7 +1018,7 @@ mail emailchange_subject = "Email confirmation" emailchange_message = "Hi, - You have requested to change your email address to %e. + You have requested to change your email address from %e to %E. Please type \" /msg NickServ CONFIRM %c \" to confirm this change. If you don't know why this mail was sent to you, please ignore it silently. diff --git a/modules/commands/ns_set.cpp b/modules/commands/ns_set.cpp index 03ebae85c..fdf2a5e38 100644 --- a/modules/commands/ns_set.cpp +++ b/modules/commands/ns_set.cpp @@ -414,10 +414,12 @@ class CommandNSSetEmail : public Command message = Config->GetBlock("mail")->Get("emailchange_message"); subject = subject.replace_all_cs("%e", u->Account()->email); + subject = subject.replace_all_cs("%E", new_email); subject = subject.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get("networkname")); subject = subject.replace_all_cs("%c", code); message = message.replace_all_cs("%e", u->Account()->email); + message = message.replace_all_cs("%E", new_email); message = message.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get("networkname")); message = message.replace_all_cs("%c", code);