summaryrefslogtreecommitdiff
path: root/modules/core/ms_ignore.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-11-24 21:40:56 -0600
committerAdam <Adam@anope.org>2010-12-12 19:36:19 -0500
commitcb6ef574e3df5cc846247450b74ca37d265f319e (patch)
tree8ce3374a537c312af63c78125bfea4622bb188f0 /modules/core/ms_ignore.cpp
parent37e02a3594fdddc3d5a3df0501c528f42db6c4da (diff)
Send replies from fantasy commands back to the channel, this will be expanded on later
Diffstat (limited to 'modules/core/ms_ignore.cpp')
-rw-r--r--modules/core/ms_ignore.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/modules/core/ms_ignore.cpp b/modules/core/ms_ignore.cpp
index 347657437..078f8abcc 100644
--- a/modules/core/ms_ignore.cpp
+++ b/modules/core/ms_ignore.cpp
@@ -20,8 +20,10 @@ class CommandMSIgnore : public Command
{
}
- CommandReturn Execute(User *u, const std::vector<Anope::string> &params)
+ CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> &params)
{
+ User *u = source.u;
+
Anope::string channel = params[0];
Anope::string command = (params.size() > 1 ? params[1] : "");
Anope::string param = (params.size() > 2 ? params[2] : "");
@@ -38,21 +40,21 @@ class CommandMSIgnore : public Command
if (!mi)
{
if (isforbid)
- u->SendMessage(MemoServ, ischan ? CHAN_X_FORBIDDEN : NICK_X_FORBIDDEN, channel.c_str());
+ source.Reply(ischan ? CHAN_X_FORBIDDEN : NICK_X_FORBIDDEN, channel.c_str());
else
- u->SendMessage(MemoServ, ischan ? CHAN_X_NOT_REGISTERED : NICK_X_NOT_REGISTERED, channel.c_str());
+ source.Reply(ischan ? CHAN_X_NOT_REGISTERED : NICK_X_NOT_REGISTERED, channel.c_str());
}
else if (ischan && !check_access(u, cs_findchan(channel), CA_MEMO))
- u->SendMessage(MemoServ, ACCESS_DENIED);
+ source.Reply(ACCESS_DENIED);
else if (command.equals_ci("ADD") && !param.empty())
{
if (std::find(mi->ignores.begin(), mi->ignores.end(), param.ci_str()) == mi->ignores.end())
{
mi->ignores.push_back(param.ci_str());
- u->SendMessage(MemoServ, MEMO_IGNORE_ADD, param.c_str());
+ source.Reply(MEMO_IGNORE_ADD, param.c_str());
}
else
- u->SendMessage(MemoServ, MEMO_IGNORE_ALREADY_IGNORED, param.c_str());
+ source.Reply(MEMO_IGNORE_ALREADY_IGNORED, param.c_str());
}
else if (command.equals_ci("DEL") && !param.empty())
{
@@ -61,20 +63,20 @@ class CommandMSIgnore : public Command
if (it != mi->ignores.end())
{
mi->ignores.erase(it);
- u->SendMessage(MemoServ, MEMO_IGNORE_DEL, param.c_str());
+ source.Reply(MEMO_IGNORE_DEL, param.c_str());
}
else
- u->SendMessage(MemoServ, MEMO_IGNORE_NOT_IGNORED, param.c_str());
+ source.Reply(MEMO_IGNORE_NOT_IGNORED, param.c_str());
}
else if (command.equals_ci("LIST"))
{
if (mi->ignores.empty())
- u->SendMessage(MemoServ, MEMO_IGNORE_LIST_EMPTY);
+ source.Reply(MEMO_IGNORE_LIST_EMPTY);
else
{
- u->SendMessage(MemoServ, MEMO_IGNORE_LIST_HEADER);
+ source.Reply(MEMO_IGNORE_LIST_HEADER);
for (unsigned i = 0; i < mi->ignores.size(); ++i)
- u->SendMessage(Config->s_MemoServ, " %s", mi->ignores[i].c_str());
+ source.Reply(" %s", mi->ignores[i].c_str());
}
}
else