aboutsummaryrefslogtreecommitdiff
path: root/src/listmode.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/listmode.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/listmode.cpp')
-rw-r--r--src/listmode.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/listmode.cpp b/src/listmode.cpp
index 2e20c527f..4fd77d7f0 100644
--- a/src/listmode.cpp
+++ b/src/listmode.cpp
@@ -155,14 +155,14 @@ unsigned long ListModeBase::GetLowerLimit()
return limit;
}
-ModeAction ListModeBase::OnModeChange(User* source, User*, Channel* channel, Modes::Change& change)
+bool ListModeBase::OnModeChange(User* source, User*, Channel* channel, Modes::Change& change)
{
LocalUser* lsource = IS_LOCAL(source);
if (change.adding)
{
// Try to canonicalise the parameter locally.
if (lsource && !ValidateParam(lsource, channel, change.param))
- return MODEACTION_DENY;
+ return false;
ChanData* cd = extItem.Get(channel);
if (cd)
@@ -176,7 +176,7 @@ ModeAction ListModeBase::OnModeChange(User* source, User*, Channel* channel, Mod
if (lsource)
TellAlreadyOnList(lsource, channel, change.param);
- return MODEACTION_DENY;
+ return false;
}
}
else
@@ -190,12 +190,12 @@ ModeAction ListModeBase::OnModeChange(User* source, User*, Channel* channel, Mod
{
// The list size might be 0 so we have to check even if just created.
TellListTooLong(lsource, channel, change.param);
- return MODEACTION_DENY;
+ return false;
}
// Add the new entry to the list.
cd->list.emplace_back(change.param, change.set_by.value_or(source->nick), change.set_at.value_or(ServerInstance->Time()));
- return MODEACTION_ALLOW;
+ return true;
}
else
{
@@ -209,14 +209,14 @@ ModeAction ListModeBase::OnModeChange(User* source, User*, Channel* channel, Mod
continue; // Doesn't match the proposed removal.
stdalgo::vector::swaperase(cd->list, it);
- return MODEACTION_ALLOW;
+ return true;
}
}
if (lsource)
TellNotSet(lsource, channel, change.param);
- return MODEACTION_DENY;
+ return false;
}
}