From 8389fbba6d92dec84745e5b8db4739f97561585e Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 22 Jan 2023 22:01:25 +0000 Subject: Replace ModeAction with bool. This enum is functionally the same as bool but with weird semantics. --- src/modules/m_chanhistory.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/modules/m_chanhistory.cpp') diff --git a/src/modules/m_chanhistory.cpp b/src/modules/m_chanhistory.cpp index 9e058c629..4a33451b8 100644 --- a/src/modules/m_chanhistory.cpp +++ b/src/modules/m_chanhistory.cpp @@ -87,20 +87,20 @@ public: syntax = ":"; } - ModeAction OnSet(User* source, Channel* channel, std::string& parameter) override + bool OnSet(User* source, Channel* channel, std::string& parameter) override { std::string::size_type colon = parameter.find(':'); if (colon == std::string::npos) { source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter)); - return MODEACTION_DENY; + return false; } std::string duration(parameter, colon+1); if ((IS_LOCAL(source)) && ((duration.length() > 10) || (!InspIRCd::IsValidDuration(duration)))) { source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter)); - return MODEACTION_DENY; + return false; } unsigned long len = ConvToNum(parameter.substr(0, colon)); @@ -108,7 +108,7 @@ public: if (!InspIRCd::Duration(duration, time) || len == 0 || (len > maxlines && IS_LOCAL(source))) { source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter)); - return MODEACTION_DENY; + return false; } if (len > maxlines) len = maxlines; @@ -128,7 +128,7 @@ public: { ext.SetFwd(channel, len, time); } - return MODEACTION_ALLOW; + return true; } void SerializeParam(Channel* chan, const HistoryList* history, std::string& out) -- cgit v1.3.1-10-gc9f91