aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorGravatar Sadie Powell2023-04-21 13:01:13 +0100
committerGravatar Sadie Powell2023-04-21 13:01:13 +0100
commite4bbe486c151f845feb426b256f94c3dcfce30a6 (patch)
tree24293231516a49d1a6035e6352e8140b64abe2ec /src/modules
parentReplace <sqlauth:allowpattern> with <sqlexemption>. (diff)
Allow also using a prefix chat in autoop and exemptchanops.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_autoop.cpp7
-rw-r--r--src/modules/m_exemptchanops.cpp7
2 files changed, 12 insertions, 2 deletions
diff --git a/src/modules/m_autoop.cpp b/src/modules/m_autoop.cpp
index 2815728d3..a2fd1fc58 100644
--- a/src/modules/m_autoop.cpp
+++ b/src/modules/m_autoop.cpp
@@ -45,7 +45,12 @@ public:
static PrefixMode* FindMode(const std::string& mid)
{
if (mid.length() == 1)
- return ServerInstance->Modes.FindPrefixMode(mid[0]);
+ {
+ PrefixMode* pm = ServerInstance->Modes.FindPrefixMode(mid[0]);
+ if (!pm)
+ pm = ServerInstance->Modes.FindPrefix(mid[0]);
+ return pm;
+ }
ModeHandler* mh = ServerInstance->Modes.FindMode(mid, MODETYPE_CHANNEL);
return mh ? mh->IsPrefixMode() : nullptr;
diff --git a/src/modules/m_exemptchanops.cpp b/src/modules/m_exemptchanops.cpp
index 6df211a55..47ee25a18 100644
--- a/src/modules/m_exemptchanops.cpp
+++ b/src/modules/m_exemptchanops.cpp
@@ -44,7 +44,12 @@ public:
static PrefixMode* FindMode(const std::string& pmode)
{
if (pmode.length() == 1)
- return ServerInstance->Modes.FindPrefixMode(pmode[0]);
+ {
+ PrefixMode* pm = ServerInstance->Modes.FindPrefixMode(pmode[0]);
+ if (!pm)
+ pm = ServerInstance->Modes.FindPrefix(pmode[0]);
+ return pm;
+ }
ModeHandler* mh = ServerInstance->Modes.FindMode(pmode, MODETYPE_CHANNEL);
return mh ? mh->IsPrefixMode() : nullptr;