summaryrefslogtreecommitdiff
path: root/modules/commands/ms_send.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-04-20 14:35:14 -0400
committerAdam <Adam@anope.org>2014-04-20 14:35:14 -0400
commit26ac315192e0d8a04d50e910697ab794eedf0cc1 (patch)
treeb9916f14fe35ce5c4de95c4194ca4ea0cb30812f /modules/commands/ms_send.cpp
parent0b6476f06ff9ce06545c421143c7d7163c750aa5 (diff)
New event system
Diffstat (limited to 'modules/commands/ms_send.cpp')
-rw-r--r--modules/commands/ms_send.cpp24
1 files changed, 10 insertions, 14 deletions
diff --git a/modules/commands/ms_send.cpp b/modules/commands/ms_send.cpp
index 2d796b505..2cf7d476e 100644
--- a/modules/commands/ms_send.cpp
+++ b/modules/commands/ms_send.cpp
@@ -10,11 +10,7 @@
*/
#include "module.h"
-
-namespace
-{
- ServiceReference<MemoServService> memoserv("MemoServService", "MemoServ");
-}
+#include "modules/memoserv.h"
class CommandMSSend : public Command
{
@@ -27,7 +23,7 @@ class CommandMSSend : public Command
void Execute(CommandSource &source, const std::vector<Anope::string> &params) override
{
- if (!memoserv)
+ if (!MemoServ::service)
return;
const Anope::string &nick = params[0];
@@ -39,14 +35,14 @@ class CommandMSSend : public Command
return;
}
- MemoServService::MemoResult result = memoserv->Send(source.GetNick(), nick, text);
- if (result == MemoServService::MEMO_SUCCESS)
+ MemoServ::MemoServService::MemoResult result = MemoServ::service->Send(source.GetNick(), nick, text);
+ if (result == MemoServ::MemoServService::MEMO_SUCCESS)
source.Reply(_("Memo sent to \002%s\002."), nick.c_str());
- else if (result == MemoServService::MEMO_INVALID_TARGET)
+ else if (result == MemoServ::MemoServService::MEMO_INVALID_TARGET)
source.Reply(_("\002%s\002 is not a registered unforbidden nick or channel."), nick.c_str());
- else if (result == MemoServService::MEMO_TOO_FAST)
+ else if (result == MemoServ::MemoServService::MEMO_TOO_FAST)
source.Reply(_("Please wait %d seconds before using the %s command again."), Config->GetModule("memoserv")->Get<time_t>("senddelay"), source.command.c_str());
- else if (result == MemoServService::MEMO_TARGET_FULL)
+ else if (result == MemoServ::MemoServService::MEMO_TARGET_FULL)
source.Reply(_("Sorry, %s currently has too many memos and cannot receive more."), nick.c_str());
}
@@ -67,11 +63,11 @@ class MSSend : public Module
CommandMSSend commandmssend;
public:
- MSSend(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR),
- commandmssend(this)
+ MSSend(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR)
+ , commandmssend(this)
{
- if (!memoserv)
+ if (!MemoServ::service)
throw ModuleException("No MemoServ!");
}
};