aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_timedbans.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2021-06-19 20:07:35 +0100
committerGravatar Sadie Powell2021-06-19 20:07:35 +0100
commitdce2d6a2557b5ea3f2b14fc3c89be3e3f4cfcd1a (patch)
tree851650b1febce2028970e01492779eee9d12a4a2 /src/modules/m_timedbans.cpp
parentMerge branch 'insp3' into master. (diff)
parentFix building the sha256 module on Haiku. (diff)
Merge branch 'insp3' into master.
Diffstat (limited to 'src/modules/m_timedbans.cpp')
-rw-r--r--src/modules/m_timedbans.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp
index 4d3f36717..ef20485a5 100644
--- a/src/modules/m_timedbans.cpp
+++ b/src/modules/m_timedbans.cpp
@@ -116,7 +116,8 @@ class CommandTban : public Command
}
Modes::ChangeList setban;
- setban.push_add(ServerInstance->Modes.FindMode('b', MODETYPE_CHANNEL), mask);
+ setban.push_add(*banmode, mask);
+
// Pass the user (instead of ServerInstance->FakeClient) to ModeHandler::Process() to
// make it so that the user sets the mode themselves
ServerInstance->Modes.Process(user, channel, NULL, setban);
@@ -126,6 +127,17 @@ class CommandTban : public Command
return CmdResult::FAILURE;
}
+ // Attempt to find the actual set ban mask.
+ for (const auto& mc : ServerInstance->Modes.GetLastChangeList().getlist())
+ {
+ if (mc.mh == *banmode)
+ {
+ // We found the actual mask.
+ mask = mc.param;
+ break;
+ }
+ }
+
T.mask = mask;
T.setter = user->nick;
T.expire = expire + (IS_REMOTE(user) ? 5 : 0);