diff options
author | Sadie Powell <sadie@witchery.services> | 2024-02-26 22:46:10 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2024-02-26 23:56:07 +0000 |
commit | 1e87849e5c218cc3d99e259f9ea43493bd8bc633 (patch) | |
tree | 4873ba987dd95addf9d7620485c7a5b1898b931a /src | |
parent | 5fa4acb1950cd21812d577f9ea6f99caaef255eb (diff) |
Rework IRCDMessage/IRCDMessageFlag.
Diffstat (limited to 'src')
-rw-r--r-- | src/process.cpp | 6 | ||||
-rw-r--r-- | src/protocol.cpp | 10 |
2 files changed, 7 insertions, 9 deletions
diff --git a/src/process.cpp b/src/process.cpp index 4ba0e23f0..51930c1fa 100644 --- a/src/process.cpp +++ b/src/process.cpp @@ -65,11 +65,11 @@ void Anope::Process(const Anope::string &buffer) return; } - if (m->HasFlag(IRCDMESSAGE_SOFT_LIMIT) ? (params.size() < m->GetParamCount()) : (params.size() != m->GetParamCount())) + if (m->HasFlag(IRCDMessage::FLAG_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()) + else if (m->HasFlag(IRCDMessage::FLAG_REQUIRE_USER) && !src.GetUser()) Log(LOG_DEBUG) << "unexpected non-user source " << source << " for " << command; - else if (m->HasFlag(IRCDMESSAGE_REQUIRE_SERVER) && !source.empty() && !src.GetServer()) + else if (m->HasFlag(IRCDMessage::FLAG_REQUIRE_SERVER) && !source.empty() && !src.GetServer()) Log(LOG_DEBUG) << "unexpected non-server source " << source << " for " << command; else m->Run(src, params, tags); diff --git a/src/protocol.cpp b/src/protocol.cpp index 091157d8e..bc97e58c8 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -441,11 +441,9 @@ Server *MessageSource::GetServer() const return this->s; } -IRCDMessage::IRCDMessage(Module *o, const Anope::string &n, unsigned p) : Service(o, "IRCDMessage", o->name + "/" + n.lower()), name(n), param_count(p) +IRCDMessage::IRCDMessage(Module *o, const Anope::string &n, size_t pc) + : Service(o, "IRCDMessage", o->name + "/" + n.lower()) + , name(n) + , param_count(pc) { } - -unsigned IRCDMessage::GetParamCount() const -{ - return this->param_count; -} |