diff options
author | Adam <Adam@anope.org> | 2010-12-23 18:39:54 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-12-23 18:39:54 -0500 |
commit | 3009540a00d392912affea5f2545134e2f657c01 (patch) | |
tree | 15be0334f0d50dd67e0ce86e4e9f6ea273225ae3 /src/protocol.cpp | |
parent | 265006b69176e1d8130284c63bcb50a1b67a426f (diff) |
Rewrote the ignore code. Adds creator and reason to /os ignore list.
Diffstat (limited to 'src/protocol.cpp')
-rw-r--r-- | src/protocol.cpp | 26 |
1 files changed, 9 insertions, 17 deletions
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::vector<Anope if (bi) ircdproto->SendMessage(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::vector<Anope } else { - /* Check if we should ignore. Operators always get through. */ - if (allow_ignore && !u->HasMode(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::vector<Anope Anope::string servername(receiver.begin() + s + 1, receiver.end()); botname = botname.substr(0, s); if (!servername.equals_ci(Config->ServerName)) - 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 ")) |