diff options
author | Adam <Adam@anope.org> | 2014-05-28 12:07:29 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2014-05-28 12:07:54 -0400 |
commit | f29e1cf383529a1a29f02b0669d973f5ee0b7a66 (patch) | |
tree | 3c33db276dc9328235bbd572641521ed44458176 /src/mail.cpp | |
parent | 1253c70e0682fa1490c99c3d2869049a0e3fa2e0 (diff) |
Move most of the core pseudoclient logic to modules
Diffstat (limited to 'src/mail.cpp')
-rw-r--r-- | src/mail.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mail.cpp b/src/mail.cpp index e514c19ec..342a49a24 100644 --- a/src/mail.cpp +++ b/src/mail.cpp @@ -13,6 +13,9 @@ #include "services.h" #include "mail.h" #include "config.h" +#include "bots.h" +#include "protocol.h" +#include "modules/nickserv.h" Mail::Message::Message(const Anope::string &sf, const Anope::string &mailto, const Anope::string &a, const Anope::string &s, const Anope::string &m) : Thread(), sendmail_path(Config->GetBlock("mail")->Get<const Anope::string>("sendmailpath")), send_from(sf), mail_to(mailto), addr(a), subject(s), message(m), dont_quote_addresses(Config->GetBlock("mail")->Get<bool>("dontquoteaddresses")), success(false) { @@ -51,13 +54,13 @@ void Mail::Message::Run() SetExitState(); } -bool Mail::Send(User *u, NickCore *nc, BotInfo *service, const Anope::string &subject, const Anope::string &message) +bool Mail::Send(User *u, NickServ::Account *nc, BotInfo *service, const Anope::string &subject, const Anope::string &message) { if (!nc || !service || subject.empty() || message.empty()) return false; Configuration::Block *b = Config->GetBlock("mail"); - + if (!u) { if (!b->Get<bool>("usemail") || b->Get<const Anope::string>("sendfrom").empty()) @@ -90,7 +93,7 @@ bool Mail::Send(User *u, NickCore *nc, BotInfo *service, const Anope::string &su } } -bool Mail::Send(NickCore *nc, const Anope::string &subject, const Anope::string &message) +bool Mail::Send(NickServ::Account *nc, const Anope::string &subject, const Anope::string &message) { Configuration::Block *b = Config->GetBlock("mail"); if (!b->Get<bool>("usemail") || b->Get<const Anope::string>("sendfrom").empty() || !nc || nc->email.empty() || subject.empty() || message.empty()) |