From 65fe0fc67defc6c883537c7aeab87cd7b97da770 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 16 Oct 2022 22:15:31 +0100 Subject: Remove is_registered in services_account. The account can never be an empty string so this check is useless. --- src/modules/m_services_account.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp index 86e39be23..f9e36d556 100644 --- a/src/modules/m_services_account.cpp +++ b/src/modules/m_services_account.cpp @@ -276,15 +276,13 @@ public: const std::string* account = accountapi.GetAccountName(user); - bool is_registered = account && !account->empty(); - switch (target.type) { case MessageTarget::TYPE_CHANNEL: { Channel* targetchan = target.Get(); - if (!targetchan->IsModeSet(regmoderatedmode) || is_registered) + if (!targetchan->IsModeSet(regmoderatedmode) || account) return MOD_RES_PASSTHRU; if (CheckExemption::Call(exemptionprov, user, targetchan, "regmoderated") == MOD_RES_ALLOW) @@ -297,7 +295,7 @@ public: case MessageTarget::TYPE_USER: { User* targetuser = target.Get(); - if (!targetuser->IsModeSet(regdeafmode) || is_registered) + if (!targetuser->IsModeSet(regdeafmode) || account) return MOD_RES_PASSTHRU; if (calleridapi && calleridapi->IsOnAcceptList(user, targetuser)) @@ -330,13 +328,11 @@ public: const std::string* account = accountapi.GetAccountName(user); - bool is_registered = account && !account->empty(); - if (chan) { if (chan->IsModeSet(reginvitemode)) { - if (!is_registered) + if (!account) { // joining a +R channel and not identified user->WriteNumeric(ERR_NEEDREGGEDNICK, chan->name, "You need to be identified to a registered account to join this channel"); -- cgit v1.3.1-10-gc9f91