summaryrefslogtreecommitdiff
path: root/src/protocol.cpp
diff options
context:
space:
mode:
authorDukePyrolator <DukePyrolator@anope.org>2010-12-24 06:42:55 +0100
committerDukePyrolator <DukePyrolator@anope.org>2010-12-24 06:42:55 +0100
commit4235df2b28a26cb166a250d016f1fd9b417cb94b (patch)
tree71e7d99d4cf1c3f679593ff982baa37689f7b3e7 /src/protocol.cpp
parenta0ad3c4fef7e35c68dee128950ef95c0c56849fe (diff)
parent1a3ba00c246803ee06a680060454fb6782e5dd7d (diff)
Merge branch '1.9' of ssh://anope.git.sourceforge.net/gitroot/anope/anope into 1.9
Diffstat (limited to 'src/protocol.cpp')
-rw-r--r--src/protocol.cpp26
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 "))