summaryrefslogtreecommitdiff
path: root/src/botserv.cpp
diff options
context:
space:
mode:
authorDukePyrolator <DukePyrolator@anope.org>2010-08-02 19:42:00 +0200
committerDukePyrolator <DukePyrolator@anope.org>2010-08-02 19:42:00 +0200
commit503215f39ce5b61a33e544c1d8e3d75d9e5a5260 (patch)
tree181fa3c9fb0bce5bef5730b8c83a4b1efede400a /src/botserv.cpp
parentddb886aa99a5bbdfbac8a1d3738e296d1ade7af4 (diff)
changed the way how CTCP PINGs are processed, all services clients can now reply to CTCP PING and CTCP VERSION requests
Diffstat (limited to 'src/botserv.cpp')
-rw-r--r--src/botserv.cpp24
1 files changed, 2 insertions, 22 deletions
diff --git a/src/botserv.cpp b/src/botserv.cpp
index 321060f29..381223681 100644
--- a/src/botserv.cpp
+++ b/src/botserv.cpp
@@ -67,26 +67,6 @@ void bs_init()
/*************************************************************************/
-/* Main BotServ routine. */
-
-void botserv(User *u, BotInfo *bi, const Anope::string &buf)
-{
- if (!u || !bi || buf.empty())
- return;
-
- if (buf.substr(0, 6).equals_ci("\1PING ") && buf[buf.length() - 1] == '\1')
- {
- Anope::string command = buf;
- command.erase(command.begin());
- command.erase(command.end());
- ircdproto->SendCTCP(bi, u->nick, "%s", command.c_str());
- }
- else
- mod_run_cmd(bi, u, buf);
-}
-
-/*************************************************************************/
-
/* Handles all messages that are sent to registered channels where a
* bot is on.
*/
@@ -101,7 +81,7 @@ void botchanmsgs(User *u, ChannelInfo *ci, const Anope::string &buf)
{
Anope::string ctcp = buf;
ctcp.erase(ctcp.begin());
- ctcp.erase(ctcp.end());
+ ctcp.erase(ctcp.end() - 1);
ircdproto->SendCTCP(ci->bi, u->nick, "%s", ctcp.c_str());
}
@@ -366,7 +346,7 @@ void botchanmsgs(User *u, ChannelInfo *ci, const Anope::string &buf)
if (!sep.StreamEnd())
bbuf += " " + sep.GetRemaining();
- chanserv(u, bbuf);
+ mod_run_cmd(ChanServ, u, bbuf);
}
FOREACH_MOD(I_OnBotFantasy, OnBotFantasy(token, u, ci, sep.GetRemaining()));