From 3009540a00d392912affea5f2545134e2f657c01 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 23 Dec 2010 18:39:54 -0500 Subject: Rewrote the ignore code. Adds creator and reason to /os ignore list. --- src/protocol.cpp | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) (limited to 'src/protocol.cpp') diff --git a/src/protocol.cpp b/src/protocol.cpp index cc4112970..9d10c9a0d 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -382,7 +382,7 @@ bool IRCdMessage::OnPrivmsg(const Anope::string &source, const std::vectorSendMessage(bi, source, "%s", GetString(USER_RECORD_NOT_FOUND).c_str()); - return MOD_CONT; + return true; } if (receiver[0] == '#' && !Config->s_BotServ.empty()) @@ -394,19 +394,6 @@ bool IRCdMessage::OnPrivmsg(const Anope::string &source, const std::vectorHasMode(UMODE_OPER)) - { - if (get_ignore(source)) - { - Anope::string target = myStrGetToken(message, ' ', 0); - BotInfo *bi = findbot(target); - if (bi) - Log(bi) << "Ignored message from " << source << " using command " << target; - return MOD_CONT; - } - } - /* If a server is specified (nick@server format), make sure it matches * us, and strip it off. */ Anope::string botname = receiver; @@ -416,22 +403,27 @@ bool IRCdMessage::OnPrivmsg(const Anope::string &source, const std::vectorServerName)) - return MOD_CONT; + return true; } else if (Config->UseStrictPrivMsg) { BotInfo *bi = findbot(receiver); if (!bi) - return MOD_CONT; + return true; Log(LOG_DEBUG) << "Ignored PRIVMSG without @ from " << source; u->SendMessage(bi, INVALID_TARGET, receiver.c_str(), receiver.c_str(), Config->ServerName.c_str(), receiver.c_str()); - return MOD_CONT; + return true; } BotInfo *bi = findbot(botname); if (bi) { + EventReturn MOD_RESULT; + FOREACH_RESULT(I_OnBotPrivmsg, OnBotPrivmsg(u, bi, message)); + if (MOD_RESULT == EVENT_STOP) + return true; + if (message[0] == '\1' && message[message.length() - 1] == '\1') { if (message.substr(0, 6).equals_ci("\1PING ")) -- cgit