aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_timedbans.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-12-19 11:29:55 +0000
committerGravatar Sadie Powell2022-12-19 11:29:55 +0000
commitdcd6fa89bc75da4c05031b5af4e44304e3ad6980 (patch)
treeef469c114c23d99b71cccdba1ee5acdfb364d6ce /src/modules/m_timedbans.cpp
parentUse in_port_t instead of int/unsigned int/long. (diff)
Fix parsing extbans in banredirect and timedbans.
Diffstat (limited to 'src/modules/m_timedbans.cpp')
-rw-r--r--src/modules/m_timedbans.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp
index b5348c84b..6dd1d9f79 100644
--- a/src/modules/m_timedbans.cpp
+++ b/src/modules/m_timedbans.cpp
@@ -32,6 +32,7 @@
#include "inspircd.h"
#include "listmode.h"
+#include "modules/extban.h"
#include "numerichelper.h"
// Holds a timed ban
@@ -50,7 +51,9 @@ timedbans TimedBanList;
class CommandTban final
: public Command
{
+private:
ChanModeReference banmode;
+ ExtBan::ManagerRef extbanmgr;
bool IsBanSet(Channel* chan, const std::string& mask)
{
@@ -77,6 +80,7 @@ public:
CommandTban(Module* Creator)
: Command(Creator, "TBAN", 3)
, banmode(Creator, "ban")
+ , extbanmgr(Creator)
{
syntax = { "<channel> <duration> <banmask>" };
}
@@ -107,9 +111,8 @@ public:
unsigned long expire = duration + ServerInstance->Time();
std::string mask = parameters[2];
- bool isextban = ((mask.size() > 2) && (mask[1] == ':'));
- if (!isextban && !InspIRCd::IsValidMask(mask))
- mask.append("!*@*");
+ if (!extbanmgr || !extbanmgr->Canonicalize(mask))
+ ModeParser::CleanMask(mask);
if (IsBanSet(channel, mask))
{