1
0
mirror of https://github.com/anope/anope.git synced 2026-06-25 11:16:37 +02:00

Change the return type of ircdmessage to void now that we don't use it, add an ircd message module event, and a few more fixups

This commit is contained in:
Adam
2012-11-23 16:56:06 -05:00
parent 0e7bd9f3ba
commit 36b1166cf6
17 changed files with 227 additions and 345 deletions
+6 -3
View File
@@ -75,8 +75,13 @@ void Anope::Process(const Anope::string &buffer)
}
static const Anope::string proto_name = ModuleManager::FindFirstOf(PROTOCOL) ? ModuleManager::FindFirstOf(PROTOCOL)->name : "";
MessageSource src(source);
// event
EventReturn MOD_RESULT;
FOREACH_RESULT(I_OnMessage, OnMessage(src, command, params));
if (MOD_RESULT == EVENT_STOP)
return;
ServiceReference<IRCDMessage> m("IRCDMessage", proto_name + "/" + command.lower());
if (!m)
@@ -85,8 +90,6 @@ void Anope::Process(const Anope::string &buffer)
return;
}
MessageSource src(source);
if (m->HasFlag(IRCDMESSAGE_SOFT_LIMIT) ? (params.size() < m->GetParamCount()) : (params.size() != m->GetParamCount()))
Log(LOG_DEBUG) << "invalid parameters for " << command << ": " << params.size() << " != " << m->GetParamCount();
else if (m->HasFlag(IRCDMESSAGE_REQUIRE_USER) && !src.GetUser())