From: Sadie Powell Date: Tue, 28 Jan 2020 14:31:40 +0000 (+0000) Subject: Add a vendor cap which rejects any attempts to enable it. X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=0256a41f6fe9d11baa6a894996c3ab4217f1296a;p=user%2Fhenk%2Fcode%2Finspircd.git Add a vendor cap which rejects any attempts to enable it. This is similar to the oragono.io/nope capability only instead of killing the connection it just rejects the request. This should be less intrusive for users. --- diff --git a/src/modules/m_cap.cpp b/src/modules/m_cap.cpp index f87b20831..11c93c76a 100644 --- a/src/modules/m_cap.cpp +++ b/src/modules/m_cap.cpp @@ -449,13 +449,31 @@ class CommandCap : public SplitCommand } }; +class PoisonCap : public Cap::Capability +{ + public: + PoisonCap(Module* mod) + : Cap::Capability(mod, "inspircd.org/poison") + { + } + + bool OnRequest(LocalUser* user, bool adding) CXX11_OVERRIDE + { + // Reject the attempt to enable this capability. + return false; + } +}; + class ModuleCap : public Module { + private: CommandCap cmd; + PoisonCap cap; public: ModuleCap() : cmd(this) + , cap(this) { }