diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/botserv.c | 38 |
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 |