aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_chanhistory.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2023-01-22 22:01:25 +0000
committerGravatar Sadie Powell2023-01-22 22:52:30 +0000
commit8389fbba6d92dec84745e5b8db4739f97561585e (patch)
treea1ef829a156d002639035acec8bab8a4e8d1bdfd /src/modules/m_chanhistory.cpp
parentConvert various enums to strongly typed scoped enums. (diff)
Replace ModeAction with bool.
This enum is functionally the same as bool but with weird semantics.
Diffstat (limited to 'src/modules/m_chanhistory.cpp')
-rw-r--r--src/modules/m_chanhistory.cpp10
1 files changed, 5 insertions, 5 deletions
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 = "<max-messages>:<max-duration>";
}
- 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<unsigned long>(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)