aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/m_timedbans.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2021-06-18 18:03:44 +0100
committerGravatar Sadie Powell2021-06-18 18:09:39 +0100
commit193cd02c6b155e417144a700ba12551e06c76950 (patch)
tree5ba65e9211099bec029142a5e8b3b8670019317d /src/modules/m_timedbans.cpp
parentAvoid unnecessarily looking up the ban mode. (diff)
Fix unsetting timed bans with excessively long masks.
Diffstat (limited to 'src/modules/m_timedbans.cpp')
-rw-r--r--src/modules/m_timedbans.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp
index 23dbf46c1..97074a686 100644
--- a/src/modules/m_timedbans.cpp
+++ b/src/modules/m_timedbans.cpp
@@ -128,6 +128,19 @@ class CommandTban : public Command
return CMD_FAILURE;
}
+ // Attempt to find the actual set ban mask.
+ const Modes::ChangeList::List& list = ServerInstance->Modes->GetLastChangeList().getlist();
+ for (Modes::ChangeList::List::const_iterator iter = list.begin(); iter != list.end(); ++iter)
+ {
+ const Modes::Change& mc = *iter;
+ 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);