aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_servprotect.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2021-07-17 18:35:08 +0100
committerGravatar Sadie Powell2021-07-17 18:35:08 +0100
commit805dbd4def1a83a387118d40300764c4660ffbfe (patch)
tree6db5d76f7d472fd1ae42095b1e4c454cfef4d8e5 /src/modules/m_servprotect.cpp
parentFix a shortening issue in hostchange. (diff)
parentFix ssl_mbedtls on mbedTLS v3. (diff)
Merge branch 'insp3' into master.
Diffstat (limited to 'src/modules/m_servprotect.cpp')
-rw-r--r--src/modules/m_servprotect.cpp17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/modules/m_servprotect.cpp b/src/modules/m_servprotect.cpp
index 6dc0dbe63..2fdf57ad2 100644
--- a/src/modules/m_servprotect.cpp
+++ b/src/modules/m_servprotect.cpp
@@ -27,9 +27,6 @@
enum
{
- // From AustHex.
- RPL_WHOISSERVICE = 310,
-
// From UnrealIRCd.
ERR_KILLDENY = 485
};
@@ -57,9 +54,8 @@ class ServProtectMode final
}
};
-class ModuleServProtectMode
+class ModuleServProtectMode final
: public Module
- , public Whois::EventListener
, public Whois::LineEventListener
{
private:
@@ -68,20 +64,11 @@ class ModuleServProtectMode
public:
ModuleServProtectMode()
: Module(VF_VENDOR, "Adds user mode k (servprotect) which protects services pseudoclients from being kicked, being killed, or having their channel prefix modes changed.")
- , Whois::EventListener(this)
, Whois::LineEventListener(this)
, bm(this)
{
}
- void OnWhois(Whois::Context& whois) override
- {
- if (whois.GetTarget()->IsModeSet(bm))
- {
- whois.SendLine(RPL_WHOISSERVICE, "is a Network Service on " + ServerInstance->Config->Network);
- }
- }
-
ModResult OnRawMode(User* user, Channel* chan, const Modes::Change& change) override
{
/* Check that the mode is not a server mode, it is being removed, the user making the change is local, there is a parameter,
@@ -142,7 +129,7 @@ class ModuleServProtectMode
ModResult OnWhoisLine(Whois::Context& whois, Numeric::Numeric& numeric) override
{
- return ((numeric.GetNumeric() == 319) && whois.GetTarget()->IsModeSet(bm)) ? MOD_RES_DENY : MOD_RES_PASSTHRU;
+ return ((numeric.GetNumeric() == RPL_WHOISCHANNELS) && whois.GetTarget()->IsModeSet(bm)) ? MOD_RES_DENY : MOD_RES_PASSTHRU;
}
};