diff options
Diffstat (limited to 'src/modules/m_timedbans.cpp')
| -rw-r--r-- | src/modules/m_timedbans.cpp | 14 |
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); |
