aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_commonchans.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2024-07-13 00:38:25 +0100
committerGravatar Sadie Powell2024-07-13 00:38:25 +0100
commitc3c97b917de8426cc0c0e9d87eda4efcfa88ef61 (patch)
tree72dd6f05130450b7125c2114483ffd63fad3a3fa /src/modules/m_commonchans.cpp
parentFix an unescaped ampersand in the previous commit. (diff)
Allow using /ACCEPT to override more blocking modes.
Diffstat (limited to 'src/modules/m_commonchans.cpp')
-rw-r--r--src/modules/m_commonchans.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/modules/m_commonchans.cpp b/src/modules/m_commonchans.cpp
index 94314b51d..33ed4bd99 100644
--- a/src/modules/m_commonchans.cpp
+++ b/src/modules/m_commonchans.cpp
@@ -22,6 +22,7 @@
#include "inspircd.h"
+#include "modules/callerid.h"
#include "modules/ctctags.h"
#include "numerichelper.h"
@@ -30,6 +31,7 @@ class ModuleCommonChans final
, public CTCTags::EventListener
{
private:
+ CallerID::API calleridapi;
SimpleUserMode mode;
bool IsExempt(User* source, User* target)
@@ -40,6 +42,9 @@ private:
if (source->HasPrivPermission("users/ignore-commonchans") || source->server->IsService())
return true; // Source is an oper or a service.
+ if (calleridapi && calleridapi->IsOnAcceptList(source, target))
+ return true; // Source is on the callerid accept list
+
return false;
}
@@ -60,6 +65,7 @@ public:
ModuleCommonChans()
: Module(VF_VENDOR, "Adds user mode c (deaf_commonchan) which requires users to have a common channel before they can privately message each other.")
, CTCTags::EventListener(this)
+ , calleridapi(this)
, mode(this, "deaf_commonchan", 'c')
{
}