summaryrefslogtreecommitdiff
path: root/modules/commands/ns_set.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/commands/ns_set.cpp')
-rw-r--r--modules/commands/ns_set.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/modules/commands/ns_set.cpp b/modules/commands/ns_set.cpp
index 132bd6947..dc007289e 100644
--- a/modules/commands/ns_set.cpp
+++ b/modules/commands/ns_set.cpp
@@ -1,6 +1,6 @@
/* NickServ core functions
*
- * (C) 2003-2016 Anope Team
+ * (C) 2003-2017 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
@@ -413,31 +413,31 @@ class CommandNSSASetDisplay : public CommandNSSetDisplay
class CommandNSSetEmail : public Command
{
- static bool SendConfirmMail(User *u, BotInfo *bi, const Anope::string &new_email)
+ static bool SendConfirmMail(User *u, NickCore *nc, BotInfo *bi, const Anope::string &new_email)
{
Anope::string code = Anope::Random(9);
-
- std::pair<Anope::string, Anope::string> *n = u->Account()->Extend<std::pair<Anope::string, Anope::string> >("ns_set_email");
+
+ std::pair<Anope::string, Anope::string> *n = nc->Extend<std::pair<Anope::string, Anope::string> >("ns_set_email");
n->first = new_email;
n->second = code;
Anope::string subject = Config->GetBlock("mail")->Get<const Anope::string>("emailchange_subject"),
message = Config->GetBlock("mail")->Get<const Anope::string>("emailchange_message");
- subject = subject.replace_all_cs("%e", u->Account()->email);
+ subject = subject.replace_all_cs("%e", nc->email);
subject = subject.replace_all_cs("%E", new_email);
subject = subject.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname"));
subject = subject.replace_all_cs("%c", code);
- message = message.replace_all_cs("%e", u->Account()->email);
+ message = message.replace_all_cs("%e", nc->email);
message = message.replace_all_cs("%E", new_email);
message = message.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname"));
message = message.replace_all_cs("%c", code);
- Anope::string old = u->Account()->email;
- u->Account()->email = new_email;
- bool b = Mail::Send(u, u->Account(), bi, subject, message);
- u->Account()->email = old;
+ Anope::string old = nc->email;
+ nc->email = new_email;
+ bool b = Mail::Send(u, nc, bi, subject, message);
+ nc->email = old;
return b;
}
@@ -493,7 +493,7 @@ class CommandNSSetEmail : public Command
if (!param.empty() && Config->GetModule("nickserv")->Get<bool>("confirmemailchanges") && !source.IsServicesOper())
{
- if (SendConfirmMail(source.GetUser(), source.service, param))
+ if (SendConfirmMail(source.GetUser(), source.GetAccount(), source.service, param))
source.Reply(_("A confirmation e-mail has been sent to \002%s\002. Follow the instructions in it to change your e-mail address."), param.c_str());
}
else
@@ -1176,7 +1176,7 @@ class NSSet : public Module
SerializableExtensibleItem<bool> autoop, killprotect, kill_quick, kill_immed,
message, secure, noexpire;
-
+
struct KeepModes : SerializableExtensibleItem<bool>
{
KeepModes(Module *m, const Anope::string &n) : SerializableExtensibleItem<bool>(m, n) { }