From 752f5e269e99acdd0c2795a2c2eedc44875d5fed Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 25 Feb 2025 23:13:54 +0000 Subject: Deduplicate RPC parameter count checks. --- include/modules/rpc.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/modules/rpc.h b/include/modules/rpc.h index 640eebda1..cd0578729 100644 --- a/include/modules/rpc.h +++ b/include/modules/rpc.h @@ -173,10 +173,12 @@ class RPC::Event { private: Anope::string event; + size_t minparams; protected: - Event(const Anope::string& e) + Event(const Anope::string& e, size_t mp = 0) : event(e) + , minparams(mp) { } @@ -185,6 +187,8 @@ public: const auto &GetEvent() const { return event; } + const auto &GetMinParams() const { return minparams; } + virtual bool Run(ServiceInterface *iface, HTTPClient *client, Request &request) = 0; }; -- cgit