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_cloak.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/modules/m_cloak.cpp') diff --git a/src/modules/m_cloak.cpp b/src/modules/m_cloak.cpp index 50bb95ec4..8c02ffc1e 100644 --- a/src/modules/m_cloak.cpp +++ b/src/modules/m_cloak.cpp @@ -146,7 +146,7 @@ public: return cloaks->empty() ? nullptr : cloaks; } - ModeAction OnModeChange(User* source, User* dest, Channel* channel, Modes::Change& change) override + bool OnModeChange(User* source, User* dest, Channel* channel, Modes::Change& change) override { // For remote users blindly allow this LocalUser* user = IS_LOCAL(dest); @@ -155,12 +155,12 @@ public: // Remote setters broadcast mode before host while local setters do the opposite. active = IS_LOCAL(source) ? change.adding : !change.adding; dest->SetMode(this, change.adding); - return MODEACTION_ALLOW; + return true; } // Don't allow the mode change if its a no-op or a spam change. if (change.adding == user->IsModeSet(this) || CheckSpam(user)) - return MODEACTION_DENY; + return false; // Penalise changing the mode to avoid spam. if (source == dest) @@ -171,7 +171,7 @@ public: // Remove the mode and restore their real host. user->SetMode(this, false); user->ChangeDisplayedHost(user->GetRealHost()); - return MODEACTION_ALLOW; + return true; } // If a user is not fully connected and their displayed hostname is @@ -179,7 +179,7 @@ public: // them by services. We should avoid automatically setting cloak on // them in this case. if (!user->IsFullyConnected() && user->GetRealHost() != user->GetDisplayedHost()) - return MODEACTION_DENY; + return false; auto* cloaks = GetCloaks(user); if (cloaks) @@ -187,9 +187,9 @@ public: // We were able to generate cloaks for this user. user->ChangeDisplayedHost(cloaks->front()); user->SetMode(this, true); - return MODEACTION_ALLOW; + return true; } - return MODEACTION_DENY; + return false; } }; -- cgit v1.3.1-10-gc9f91