aboutsummaryrefslogtreecommitdiffstats
path: root/src/coremods
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-10-29 13:30:39 +0100
committerGravatar Sadie Powell2022-10-29 13:43:11 +0100
commit5a508c19ff3dec65bb4148883d38127d7c0be79e (patch)
tree2bdfcbadfdfbe0a6fd244260a9570be86a3eb8d4 /src/coremods
parentAllow UserManager::Find{Nick,UUID,} to ignore unregistered users. (diff)
Use User::IsFullyConnected instead of checking for REG_ALL.
Diffstat (limited to 'src/coremods')
-rw-r--r--src/coremods/core_lusers.cpp2
-rw-r--r--src/coremods/core_message.cpp2
-rw-r--r--src/coremods/core_oper/cmd_die.cpp2
-rw-r--r--src/coremods/core_user/cmd_nick.cpp2
-rw-r--r--src/coremods/core_user/core_user.cpp2
-rw-r--r--src/coremods/core_who.cpp2
-rw-r--r--src/coremods/core_xline/core_xline.cpp2
7 files changed, 7 insertions, 7 deletions
diff --git a/src/coremods/core_lusers.cpp b/src/coremods/core_lusers.cpp
index 7f98b600f..852a2b385 100644
--- a/src/coremods/core_lusers.cpp
+++ b/src/coremods/core_lusers.cpp
@@ -133,7 +133,7 @@ public:
void AfterMode(User* source, User* dest, Channel* channel, const Modes::Change& change) override
{
- if (dest->registered != REG_ALL)
+ if (!dest->IsFullyConnected())
return;
if (dest->server->IsService())
diff --git a/src/coremods/core_message.cpp b/src/coremods/core_message.cpp
index 4a1efe450..5338d3666 100644
--- a/src/coremods/core_message.cpp
+++ b/src/coremods/core_message.cpp
@@ -197,7 +197,7 @@ private:
for (auto* luser : ServerInstance->Users.GetLocalUsers())
{
// Don't send to unregistered users or the user who is the source.
- if (luser->registered != REG_ALL || luser == source)
+ if (!luser->IsFullyConnected() || luser == source)
continue;
// Only send to non-exempt users.
diff --git a/src/coremods/core_oper/cmd_die.cpp b/src/coremods/core_oper/cmd_die.cpp
index c60f793a5..df2a306e0 100644
--- a/src/coremods/core_oper/cmd_die.cpp
+++ b/src/coremods/core_oper/cmd_die.cpp
@@ -46,7 +46,7 @@ void DieRestart::SendError(const std::string& message)
for (auto* user : ServerInstance->Users.GetLocalUsers())
{
- if (user->registered == REG_ALL)
+ if (user->IsFullyConnected())
{
user->WriteNotice(message);
}
diff --git a/src/coremods/core_user/cmd_nick.cpp b/src/coremods/core_user/cmd_nick.cpp
index 4cb641ed1..9dc23981a 100644
--- a/src/coremods/core_user/cmd_nick.cpp
+++ b/src/coremods/core_user/cmd_nick.cpp
@@ -47,7 +47,7 @@ CmdResult CommandNick::HandleLocal(LocalUser* user, const Params& parameters)
std::string newnick = parameters[0];
// anything except the initial NICK gets a flood penalty
- if (user->registered == REG_ALL)
+ if (user->IsFullyConnected())
user->CommandFloodPenalty += 4000;
if (newnick.empty())
diff --git a/src/coremods/core_user/core_user.cpp b/src/coremods/core_user/core_user.cpp
index 57591a3f4..57ad1b0d5 100644
--- a/src/coremods/core_user/core_user.cpp
+++ b/src/coremods/core_user/core_user.cpp
@@ -44,7 +44,7 @@ public:
CmdResult HandleLocal(LocalUser* user, const Params& parameters) override
{
// Check to make sure they haven't registered -- Fix by FCS
- if (user->registered == REG_ALL)
+ if (user->IsFullyConnected())
{
user->CommandFloodPenalty += 1000;
user->WriteNumeric(ERR_ALREADYREGISTERED, "You may not reregister");
diff --git a/src/coremods/core_who.cpp b/src/coremods/core_who.cpp
index 70b6f0bba..43494e15f 100644
--- a/src/coremods/core_who.cpp
+++ b/src/coremods/core_who.cpp
@@ -259,7 +259,7 @@ bool CommandWho::MatchChannel(LocalUser* source, Membership* memb, WhoData& data
bool CommandWho::MatchUser(LocalUser* source, User* user, WhoData& data)
{
// Users who are not fully registered can never match.
- if (user->registered != REG_ALL)
+ if (!user->IsFullyConnected())
return false;
bool source_has_users_auspex = source->HasPrivPermission("users/auspex");
diff --git a/src/coremods/core_xline/core_xline.cpp b/src/coremods/core_xline/core_xline.cpp
index 8ca0b963b..f9d786141 100644
--- a/src/coremods/core_xline/core_xline.cpp
+++ b/src/coremods/core_xline/core_xline.cpp
@@ -146,7 +146,7 @@ public:
return MOD_RES_PASSTHRU; // No match
// A Q-line matched the new nick, tell opers if the user is registered
- if (user->registered == REG_ALL)
+ if (user->IsFullyConnected())
{
ServerInstance->SNO.WriteGlobalSno('x', "Q-lined nickname %s from %s: %s",
newnick.c_str(), user->GetFullRealHost().c_str(), xline->reason.c_str());