From cadf228c3e66ce33c3599539b6650e26dfc3bff5 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 22 Jan 2023 21:48:22 +0000 Subject: Convert various enums to strongly typed scoped enums. --- src/users.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/users.cpp') diff --git a/src/users.cpp b/src/users.cpp index c6e8ce867..7ea98a2fd 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -753,7 +753,7 @@ void User::WriteNumeric(const Numeric::Numeric& numeric) void User::WriteRemoteNotice(const std::string& text) { - ServerInstance->PI->SendMessage(this, text, MSG_NOTICE); + ServerInstance->PI->SendMessage(this, text, MessageType::NOTICE); } void LocalUser::WriteRemoteNotice(const std::string& text) @@ -981,7 +981,7 @@ void User::WriteNotice(const std::string& text) if (!localuser) return; - ClientProtocol::Messages::Privmsg msg(ClientProtocol::Messages::Privmsg::nocopy, ServerInstance->FakeClient, localuser, text, MSG_NOTICE); + ClientProtocol::Messages::Privmsg msg(ClientProtocol::Messages::Privmsg::nocopy, ServerInstance->FakeClient, localuser, text, MessageType::NOTICE); localuser->Send(ServerInstance->GetRFCEvents().privmsg, msg); } @@ -1234,10 +1234,10 @@ OperAccount::OperAccount(const std::string& n, const std::shared_ptr& , passwordhash(t->getString("hash", "plaintext", 1)) , type(o ? o->GetName() : n) { - autologin = t->getEnum("autologin", AL_NEVER, { - { "strict", AL_STRICT }, - { "relaxed", AL_RELAXED }, - { "never", AL_NEVER }, + autologin = t->getEnum("autologin", AutoLogin::NEVER, { + { "strict", AutoLogin::STRICT }, + { "relaxed", AutoLogin::RELAXED }, + { "never", AutoLogin::NEVER }, }); if (o) @@ -1256,13 +1256,13 @@ bool OperAccount::CanAutoLogin(LocalUser* user) const { switch (autologin) { - case AL_STRICT: + case AutoLogin::STRICT: return user->nick == GetName(); - case AL_RELAXED: + case AutoLogin::RELAXED: return true; - case AL_NEVER: + case AutoLogin::NEVER: return false; } -- cgit v1.3.1-10-gc9f91