diff options
author | Adam <Adam@anope.org> | 2011-02-25 21:41:08 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-02-25 21:41:08 -0500 |
commit | c38b6392c5956628f51faaa6085367dd32199e61 (patch) | |
tree | 8933d0997016756b15e10a7ad88a5d51c04d841e /src | |
parent | ee387569821b45581063f6bc349cccc643f9a293 (diff) |
More fixes. Also made db_mysql_live not keep bots updated because thats pointless and made m_asynch_commands respect user language settings.
Diffstat (limited to 'src')
-rw-r--r-- | src/bots.cpp | 5 | ||||
-rw-r--r-- | src/botserv.cpp | 2 | ||||
-rw-r--r-- | src/commands.cpp | 17 | ||||
-rw-r--r-- | src/language.cpp | 2 | ||||
-rw-r--r-- | src/protocol.cpp | 8 |
5 files changed, 15 insertions, 19 deletions
diff --git a/src/bots.cpp b/src/bots.cpp index 1f3f29009..b77031c00 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -111,11 +111,6 @@ BotInfo::~BotInfo() } } -void BotInfo::SetIdent(const Anope::string &sident) -{ - this->ident = sident; -} - void BotInfo::SetNewNick(const Anope::string &newnick) { UserListByNick.erase(this->nick); diff --git a/src/botserv.cpp b/src/botserv.cpp index 5f321a125..e65118921 100644 --- a/src/botserv.cpp +++ b/src/botserv.cpp @@ -343,7 +343,7 @@ void botchanmsgs(User *u, ChannelInfo *ci, const Anope::string &buf) message = ci->name + " " + message; message = command + " " + message; - mod_run_cmd(ChanServ, u, message, ci); + mod_run_cmd(ChanServ, u, ci, message); } FOREACH_MOD(I_OnBotFantasy, OnBotFantasy(command, u, ci, sep.GetRemaining())); diff --git a/src/commands.cpp b/src/commands.cpp index b2e3b7192..c9f66b25a 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -26,7 +26,7 @@ Command *FindCommand(BotInfo *bi, const Anope::string &name) return NULL; } -void mod_run_cmd(BotInfo *bi, User *u, const Anope::string &fullmessage, ChannelInfo *ci) +void mod_run_cmd(BotInfo *bi, User *u, ChannelInfo *ci, const Anope::string &fullmessage) { if (!bi || !u) return; @@ -45,10 +45,10 @@ void mod_run_cmd(BotInfo *bi, User *u, const Anope::string &fullmessage, Channel Command *c = FindCommand(bi, command); - mod_run_cmd(bi, u, c, command, message, ci); + mod_run_cmd(bi, u, ci, c, command, message); } -void mod_run_cmd(BotInfo *bi, User *u, Command *c, const Anope::string &command, const Anope::string &message, ChannelInfo *ci) +void mod_run_cmd(BotInfo *bi, User *u, ChannelInfo *ci, Command *c, const Anope::string &command, const Anope::string &message) { if (!bi || !u) return; @@ -166,12 +166,13 @@ void mod_run_cmd(BotInfo *bi, User *u, Command *c, const Anope::string &command, } CommandReturn ret = c->Execute(source, params); - if (ret == MOD_STOP) - return; - - FOREACH_MOD(I_OnPostCommand, OnPostCommand(source, c, params)); + if (ret != MOD_STOP) + { + FOREACH_MOD(I_OnPostCommand, OnPostCommand(source, c, params)); + source.DoReply(); + } - source.DoReply(); + PopLanguage(); } /** diff --git a/src/language.cpp b/src/language.cpp index 01ff01f81..5d2ced124 100644 --- a/src/language.cpp +++ b/src/language.cpp @@ -69,7 +69,7 @@ const char *anope_gettext(const char *string) std::pair<Anope::string, Anope::string> lang_info; if (!language_stack.empty()) lang_info = language_stack.top(); - if (lang_info.first.empty() || lang_info.second.empty()) + if (*string == 0 || lang_info.first.empty() || lang_info.second.empty()) return string; ++_nl_msg_cat_cntr; diff --git a/src/protocol.cpp b/src/protocol.cpp index 220b33622..35c9d8c0b 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -438,14 +438,14 @@ bool IRCdMessage::OnPrivmsg(const Anope::string &source, const std::vector<Anope if (!u->HasMode(UMODE_OPER) && Config->CSOpersOnly) u->SendMessage(ChanServ, LanguageString::ACCESS_DENIED); else - mod_run_cmd(bi, u, message, false); + mod_run_cmd(bi, u, NULL, message); } else if (bi == HostServ) { if (!ircd->vhost) u->SendMessage(HostServ, _("%s is currently offline."), Config->s_HostServ.c_str()); else - mod_run_cmd(bi, u, message, false); + mod_run_cmd(bi, u, NULL, message); } else if (bi == OperServ) { @@ -458,11 +458,11 @@ bool IRCdMessage::OnPrivmsg(const Anope::string &source, const std::vector<Anope else { Log(OperServ) << u->nick << ": " << message; - mod_run_cmd(bi, u, message, false); + mod_run_cmd(bi, u, NULL, message); } } else - mod_run_cmd(bi, u, message, false); + mod_run_cmd(bi, u, NULL, message); } } |