diff options
| author | 2021-06-19 20:07:35 +0100 | |
|---|---|---|
| committer | 2021-06-19 20:07:35 +0100 | |
| commit | dce2d6a2557b5ea3f2b14fc3c89be3e3f4cfcd1a (patch) | |
| tree | 851650b1febce2028970e01492779eee9d12a4a2 /src/modules/m_timedbans.cpp | |
| parent | Merge branch 'insp3' into master. (diff) | |
| parent | Fix 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.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); |
