mirror of
https://github.com/anope/anope.git
synced 2026-07-04 20:33:12 +02:00
Send replies from fantasy commands back to the channel, this will be expanded on later
This commit is contained in:
@@ -20,16 +20,18 @@ class CommandMSRSend : public Command
|
||||
{
|
||||
}
|
||||
|
||||
CommandReturn Execute(User *u, const std::vector<Anope::string> ¶ms)
|
||||
CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> ¶ms)
|
||||
{
|
||||
Anope::string nick = params[0];
|
||||
Anope::string text = params[1];
|
||||
User *u = source.u;
|
||||
|
||||
const Anope::string &nick = params[0];
|
||||
const Anope::string &text = params[1];
|
||||
NickAlias *na = NULL;
|
||||
|
||||
/* prevent user from rsend to themselves */
|
||||
if ((na = findnick(nick)) && na->nc == u->Account())
|
||||
{
|
||||
u->SendMessage(MemoServ, MEMO_NO_RSEND_SELF);
|
||||
source.Reply(MEMO_NO_RSEND_SELF);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
@@ -39,7 +41,7 @@ class CommandMSRSend : public Command
|
||||
if (u->Account()->IsServicesOper())
|
||||
memo_send(u, nick, text, 3);
|
||||
else
|
||||
u->SendMessage(MemoServ, ACCESS_DENIED);
|
||||
source.Reply(ACCESS_DENIED);
|
||||
}
|
||||
else if (Config->MSMemoReceipt == 2)
|
||||
/* Everybody can use rsend */
|
||||
@@ -48,7 +50,7 @@ class CommandMSRSend : public Command
|
||||
{
|
||||
/* rsend has been disabled */
|
||||
Log() << "MSMemoReceipt is set misconfigured to " << Config->MSMemoReceipt;
|
||||
u->SendMessage(MemoServ, MEMO_RSEND_DISABLED);
|
||||
source.Reply(MEMO_RSEND_DISABLED);
|
||||
}
|
||||
|
||||
return MOD_CONT;
|
||||
|
||||
Reference in New Issue
Block a user