aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorGravatar Sadie Powell2026-02-26 23:11:41 +0000
committerGravatar Sadie Powell2026-02-26 23:13:49 +0000
commitffc62aee625a650c08ffd68dc0d5763eec34edbc (patch)
tree63ab761eee5ad11cdf5cba8fc2171d3588e78555 /modules
parentLoad the sacommands module if a config contains the split module names. (diff)
Fix some incorrect uses of SharedData in sacommands.
Diffstat (limited to 'modules')
-rw-r--r--modules/sacommands.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/modules/sacommands.cpp b/modules/sacommands.cpp
index d0e995798..078f4f790 100644
--- a/modules/sacommands.cpp
+++ b/modules/sacommands.cpp
@@ -197,7 +197,7 @@ private:
public:
bool active = false;
- CommandSAMode(Module* mod, SharedData &sd)
+ CommandSAMode(Module* mod, SharedData& sd)
: Command(mod, "SAMODE", 2)
, data(sd)
{
@@ -216,6 +216,11 @@ public:
user->WriteNumeric(Numerics::NoSuchNick(targetstr));
return CmdResult::FAILURE;
}
+ if (target->IsModeSet(data.servprotectmode))
+ {
+ user->WriteRemoteNumeric(Numerics::NoPrivileges("you can not use the {} command on a protected service", this->name));
+ return CmdResult::FAILURE;
+ }
// Changing the modes of another user requires a special permission.
if (target != user && !user->HasPrivPermission("users/samode-usermodes"))
@@ -260,7 +265,7 @@ class CommandSANick final
: public Command
{
private:
- SharedData data;
+ SharedData& data;
public:
CommandSANick(Module* mod, SharedData& sd)
@@ -449,13 +454,9 @@ public:
class CommandSATopic final
: public Command
{
-private:
- SharedData& data;
-
public:
- CommandSATopic(Module* mod, SharedData& sd)
+ CommandSATopic(Module* mod)
: Command(mod, "SATOPIC", 2, 2)
- , data(sd)
{
access_needed = CmdAccess::OPERATOR;
allow_empty_last_param = true;
@@ -511,7 +512,7 @@ public:
, cmdsanick(this, data)
, cmdsapart(this, data)
, cmdsaquit(this, data)
- , cmdsatopic(this, data)
+ , cmdsatopic(this)
{
}