diff options
author | Adam <Adam@anope.org> | 2011-07-10 18:27:48 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-07-10 18:27:48 -0400 |
commit | 6d978486cdab14e90fe5c08d47705a599085a9d0 (patch) | |
tree | aeb7139bfccc6678e9a9c38b0e495159fb5c175d /modules | |
parent | d2832b1045a30a995bd0553fd42dcf1c1df1e57f (diff) |
Bug #1286 - Dont allow actions to mess up the caps kicker
Diffstat (limited to 'modules')
-rw-r--r-- | modules/core/bs_kick.cpp | 12 | ||||
-rw-r--r-- | modules/core/bs_main.cpp | 11 |
2 files changed, 19 insertions, 4 deletions
diff --git a/modules/core/bs_kick.cpp b/modules/core/bs_kick.cpp index 3e6719338..467f4104e 100644 --- a/modules/core/bs_kick.cpp +++ b/modules/core/bs_kick.cpp @@ -660,6 +660,18 @@ class BSKick : public Module { Anope::string realbuf = msg; + /* If it's a /me, cut the CTCP part because the ACTION will cause + * problems with the caps or badwords kicker + */ + if (realbuf.substr(0, 8).equals_ci("\1ACTION ") && realbuf[realbuf.length() - 1] == '\1') + { + realbuf.erase(0, 8); + realbuf.erase(realbuf.length() - 1); + } + + if (realbuf.empty()) + return; + /* Bolds kicker */ if (ci->botflags.HasFlag(BS_KICK_BOLDS) && realbuf.find(2) != Anope::string::npos) { diff --git a/modules/core/bs_main.cpp b/modules/core/bs_main.cpp index e325b012f..b47b7e128 100644 --- a/modules/core/bs_main.cpp +++ b/modules/core/bs_main.cpp @@ -164,6 +164,12 @@ class BotServCore : public Module ~BotServCore() { + for (channel_map::const_iterator cit = ChannelList.begin(), cit_end = ChannelList.end(); cit != cit_end; ++cit) + { + cit->second->Shrink("bs_main_userdata"); + cit->second->Shrink("bs_main_bandata"); + } + spacesepstream coreModules(Config->BotCoreModules); Anope::string module; while (coreModules.GetToken(module)) @@ -190,13 +196,10 @@ class BotServCore : public Module ircdproto->SendCTCP(ci->bi, u->nick, "%s", ctcp.c_str()); } - bool was_action = false; Anope::string realbuf = msg; - /* If it's a /me, cut the CTCP part because the ACTION will cause - * problems with the caps or badwords kicker - */ + bool was_action = false; if (realbuf.substr(0, 8).equals_ci("\1ACTION ") && realbuf[realbuf.length() - 1] == '\1') { realbuf.erase(0, 8); |