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/listmode.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/listmode.cpp') 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; } } -- cgit v1.3.1-10-gc9f91