aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_dnsbl.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2023-07-21 15:29:10 +0100
committerGravatar Sadie Powell2023-07-21 15:29:10 +0100
commitf798db93e4f2380072eadba74351a9025e36b915 (patch)
treed9885df18871a577241c9cb354e7182f3b198e40 /src/modules/m_dnsbl.cpp
parentAllow hiding silenced users messages instead of blocking. (diff)
Add support for shunning users who are in a DNSBL.
Diffstat (limited to 'src/modules/m_dnsbl.cpp')
-rw-r--r--src/modules/m_dnsbl.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp
index 57ab49442..a27e9268e 100644
--- a/src/modules/m_dnsbl.cpp
+++ b/src/modules/m_dnsbl.cpp
@@ -33,6 +33,7 @@
#include "inspircd.h"
#include "extension.h"
#include "modules/dns.h"
+#include "modules/shun.h"
#include "modules/stats.h"
#include "numerichelper.h"
#include "timeutils.h"
@@ -56,6 +57,9 @@ public:
// Mark users who's IP address is in the DNSBL.
MARK,
+ // Shun users who's IP address is in the DNSBL.
+ SHUN,
+
// Z-line users who's IP address is in the DNSBL.
ZLINE,
};
@@ -127,6 +131,7 @@ public:
{ "kill", Action::KILL },
{ "kline", Action::KLINE },
{ "mark", Action::MARK },
+ { "shun", Action::SHUN },
{ "zline", Action::ZLINE },
});
@@ -356,9 +361,9 @@ public:
if (match)
{
const std::string reason = Template::Replace(config->reason, {
- { "dnsbl", config->name },
+ { "dnsbl", config->name },
{ "ip", them->GetAddress() },
- { "result", ConvToStr(result) },
+ { "result", ConvToStr(result) },
});
config->stats_hits++;
@@ -400,6 +405,11 @@ public:
AddLine<ZLine>("Z-line", reason, config->xlineduration, them->GetAddress());
break;
}
+ case DNSBLEntry::Action::SHUN:
+ {
+ AddLine<Shun>("Shun", reason, config->xlineduration, them->GetAddress());
+ break;
+ }
}
ServerInstance->SNO.WriteGlobalSno('d', "{} {} ({}) detected as being on the '{}' DNSBL with result {}",