summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-09-16 23:31:43 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-09-16 23:31:43 +0000
commitfcf104f0ca168bff1a60da9247e2ef7cbe15fbaf (patch)
tree2488bb439c8787d7397734a06b4fbbb6413ff4d5
parent09b92517d0b2c7686394cb25d90e51a290b44fef (diff)
Really not send unknown command messages on non-fantasy commands
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2508 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--src/botserv.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/src/botserv.c b/src/botserv.c
index 48dc848ed..3fc4c5c11 100644
--- a/src/botserv.c
+++ b/src/botserv.c
@@ -428,31 +428,29 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
if (check_access(u, ci, CA_FANTASIA))
{
- if ((command = findCommand(CHANSERV, cmd)))
- {
- /* Command exists but can not be called by fantasy */
- if (command->HasFlag(CFLAG_DISABLE_FANTASY))
- notice_lang(s_ChanServ, u, UNKNOWN_COMMAND_HELP, cmd, s_ChanServ);
- else
- {
- bbuf = std::string(cmd);
+ command = findCommand(CHANSERV, cmd);
- /* Some commands don't need the channel name added.. eg !help */
- if (!command->HasFlag(CFLAG_STRIP_CHANNEL))
- {
- bbuf += " ";
- bbuf += ci->name;
- }
+ /* Command exists and can not be called by fantasy */
+ if (command && !command->HasFlag(CFLAG_DISABLE_FANTASY))
+ {
+ bbuf = std::string(cmd);
- if (params)
- {
- bbuf += " ";
- bbuf += params;
- }
+ /* Some commands don't need the channel name added.. eg !help */
+ if (!command->HasFlag(CFLAG_STRIP_CHANNEL))
+ {
+ bbuf += " ";
+ bbuf += ci->name;
+ }
- chanserv(u, const_cast<char *>(bbuf.c_str())); // XXX Unsafe cast, this needs reviewing -- CyberBotX
+ if (params)
+ {
+ bbuf += " ";
+ bbuf += params;
}
+
+ chanserv(u, const_cast<char *>(bbuf.c_str())); // XXX Unsafe cast, this needs reviewing -- CyberBotX
}
+
FOREACH_MOD(I_OnBotFantasy, OnBotFantasy(cmd, u, ci, params));
}
else