diff options
-rw-r--r-- | include/mode.h | 4 | ||||
-rw-r--r-- | src/coremods/core_user/cmd_mode.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_timedbans.cpp | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/include/mode.h b/include/mode.h index ccbfe6f28..4fa78bcac 100644 --- a/include/mode.h +++ b/include/mode.h @@ -677,6 +677,10 @@ class CoreExport ModeParser : public fakederef<ModeParser> * This method can be used on both IPV4 and IPV6 user masks. */ static void CleanMask(std::string &mask); + + /** Gets the last mode change to be processed. */ + const Modes::ChangeList& GetLastChangeList() const { return LastChangeList; } + /** Get the last string to be processed, as it was sent to the user or channel. * Use this to display a string you just sent to be parsed, as the actual output * may be different to what you sent after it has been 'cleaned up' by the parser. diff --git a/src/coremods/core_user/cmd_mode.cpp b/src/coremods/core_user/cmd_mode.cpp index a3ebda16d..101f748f1 100644 --- a/src/coremods/core_user/cmd_mode.cpp +++ b/src/coremods/core_user/cmd_mode.cpp @@ -92,7 +92,7 @@ CmdResult CommandMode::Handle(User* user, const Params& parameters) else ServerInstance->Modes->Process(user, targetchannel, targetuser, changelist, flags); - if ((ServerInstance->Modes.GetLastParse().empty()) && (targetchannel) && (parameters.size() == 2)) + if ((ServerInstance->Modes.GetLastChangeList().empty()) && (targetchannel) && (parameters.size() == 2)) { /* Special case for displaying the list for listmodes, * e.g. MODE #chan b, or MODE #chan +b without a parameter diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index fd2d3d0f0..ffb84a44f 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -107,7 +107,7 @@ class CommandTban : public Command // 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); - if (ServerInstance->Modes->GetLastParse().empty()) + if (ServerInstance->Modes->GetLastChangeList().empty()) { user->WriteNotice("Invalid ban mask"); return CMD_FAILURE; |