summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2024-04-15 21:07:52 +0100
committerSadie Powell <sadie@witchery.services>2024-04-15 21:08:40 +0100
commit5473311bd745a15f3cc718d2a3101c5b61b006fc (patch)
tree1425af6be212d2014668887f98609ac39fc006c9
parentf3ebb674696c9caf78eead88e6513e077c95d4db (diff)
Only enable os_noop on IRCDs that actually have a SendSVSNOOP impl.
-rw-r--r--data/operserv.example.conf2
-rw-r--r--include/protocol.h3
-rw-r--r--modules/operserv/os_noop.cpp3
-rw-r--r--modules/protocol/bahamut.cpp1
-rw-r--r--modules/protocol/plexus.cpp1
-rw-r--r--modules/protocol/unrealircd.cpp1
6 files changed, 9 insertions, 2 deletions
diff --git a/data/operserv.example.conf b/data/operserv.example.conf
index e23efbb47..77c969309 100644
--- a/data/operserv.example.conf
+++ b/data/operserv.example.conf
@@ -503,7 +503,7 @@ command { service = "OperServ"; name = "RANDOMNEWS"; command = "operserv/randomn
*
* Used to NOOP a server, which prevents users from opering on that server.
*/
-module { name = "os_noop" }
+#module { name = "os_noop" }
command { service = "OperServ"; name = "NOOP"; command = "operserv/noop"; permission = "operserv/noop"; }
/*
diff --git a/include/protocol.h b/include/protocol.h
index e57cd304f..92b53ef91 100644
--- a/include/protocol.h
+++ b/include/protocol.h
@@ -74,6 +74,9 @@ public:
/* Can we force join or part users? */
bool CanSVSJoin = false;
+ /** Can we force servers to remove opers? */
+ bool CanSVSNOOP = false;
+
/* Can we set vhosts on users? */
bool CanSetVHost = false;
diff --git a/modules/operserv/os_noop.cpp b/modules/operserv/os_noop.cpp
index d4049abd5..1c41181dc 100644
--- a/modules/operserv/os_noop.cpp
+++ b/modules/operserv/os_noop.cpp
@@ -82,7 +82,8 @@ public:
OSNOOP(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR),
commandosnoop(this), noop(this, "noop")
{
-
+ if (!IRCD || !IRCD->CanSVSNOOP)
+ throw ModuleException("Your IRCd does not support SVSNOOP.");
}
void OnUserModeSet(const MessageSource &, User *u, const Anope::string &mname) override
diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp
index 3322aaee1..f6d9260e3 100644
--- a/modules/protocol/bahamut.cpp
+++ b/modules/protocol/bahamut.cpp
@@ -39,6 +39,7 @@ public:
{
DefaultPseudoclientModes = "+";
CanSVSNick = true;
+ CanSVSNOOP = true;
CanSNLine = true;
CanSQLine = true;
CanSQLineChannel = true;
diff --git a/modules/protocol/plexus.cpp b/modules/protocol/plexus.cpp
index 062c86e6b..e49399602 100644
--- a/modules/protocol/plexus.cpp
+++ b/modules/protocol/plexus.cpp
@@ -25,6 +25,7 @@ public:
DefaultPseudoclientModes = "+iU";
CanSVSNick = true;
CanSVSJoin = true;
+ CanSVSNOOP = true;
CanSetVHost = true;
CanSetVIdent = true;
CanSNLine = true;
diff --git a/modules/protocol/unrealircd.cpp b/modules/protocol/unrealircd.cpp
index fddbff39d..8f6cbe455 100644
--- a/modules/protocol/unrealircd.cpp
+++ b/modules/protocol/unrealircd.cpp
@@ -28,6 +28,7 @@ public:
DefaultPseudoclientModes = "+BioqS";
CanSVSNick = true;
CanSVSJoin = true;
+ CanSVSNOOP = true;
CanSetVHost = true;
CanSetVIdent = true;
CanSNLine = true;