From 9c89a342c9dc2d535bed9410da41b6edb30b149b Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 15 Jun 2026 16:59:06 +0100 Subject: Add ModeHandler::IsSameMode. --- src/mode.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/mode.cpp') diff --git a/src/mode.cpp b/src/mode.cpp index 4ae6edbda..c70fe05b7 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -133,6 +133,20 @@ const std::string& ModeHandler::GetName(bool old) const return this->service_name; } +bool ModeHandler::IsSameMode(const std::string& mname) const +{ + switch (mname.length()) + { + case 0: + return false; // Can never match. + case 1: + return this->GetModeChar() == mname[0]; // Match the mode character. + default: + return insp::ascii_equals(this->service_name, mname); // Match the mode name. + } +} + + bool SimpleUserMode::OnModeChange(User* source, User* dest, Channel* channel, Modes::Change& change) { /* We're either trying to add a mode we already have or -- cgit v1.3.1-10-gc9f91