aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree
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/modules/m_spanningtree
parentAllow UserManager::Find{Nick,UUID,} to ignore unregistered users. (diff)
Use User::IsFullyConnected instead of checking for REG_ALL.
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r--src/modules/m_spanningtree/main.cpp12
-rw-r--r--src/modules/m_spanningtree/netburst.cpp2
-rw-r--r--src/modules/m_spanningtree/uid.cpp2
3 files changed, 8 insertions, 8 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index 241c498f5..efcac01c7 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -550,7 +550,7 @@ void ModuleSpanningTree::OnUserJoin(Membership* memb, bool sync, bool created_by
void ModuleSpanningTree::OnChangeHost(User* user, const std::string& newhost)
{
- if (user->registered != REG_ALL || !IS_LOCAL(user))
+ if (!user->IsFullyConnected() || !IS_LOCAL(user))
return;
CmdBuilder(user, "FHOST").push(newhost).Broadcast();
@@ -558,7 +558,7 @@ void ModuleSpanningTree::OnChangeHost(User* user, const std::string& newhost)
void ModuleSpanningTree::OnChangeRealHost(User* user, const std::string& newhost)
{
- if (user->registered != REG_ALL || !IS_LOCAL(user))
+ if (!user->IsFullyConnected() || !IS_LOCAL(user))
return;
CmdBuilder(user, "FRHOST").push(newhost).Broadcast();
@@ -566,7 +566,7 @@ void ModuleSpanningTree::OnChangeRealHost(User* user, const std::string& newhost
void ModuleSpanningTree::OnChangeRealName(User* user, const std::string& real)
{
- if (user->registered != REG_ALL || !IS_LOCAL(user))
+ if (!user->IsFullyConnected() || !IS_LOCAL(user))
return;
CmdBuilder(user, "FNAME").push_last(real).Broadcast();
@@ -574,7 +574,7 @@ void ModuleSpanningTree::OnChangeRealName(User* user, const std::string& real)
void ModuleSpanningTree::OnChangeIdent(User* user, const std::string& ident)
{
- if ((user->registered != REG_ALL) || (!IS_LOCAL(user)))
+ if (!user->IsFullyConnected() || !IS_LOCAL(user))
return;
CmdBuilder(user, "FIDENT").push(ident).Broadcast();
@@ -774,7 +774,7 @@ restart:
void ModuleSpanningTree::OnOper(User* user)
{
- if (user->registered != REG_ALL || !IS_LOCAL(user))
+ if (!user->IsFullyConnected() || !IS_LOCAL(user))
return;
// Note: The protocol does not allow direct umode +o;
@@ -825,7 +825,7 @@ void ModuleSpanningTree::OnMode(User* source, User* u, Channel* c, const Modes::
if (u)
{
- if (u->registered != REG_ALL)
+ if (!u->IsFullyConnected())
return;
CmdBuilder params(source, "MODE");
diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp
index 7c49c58a6..5dcc88504 100644
--- a/src/modules/m_spanningtree/netburst.cpp
+++ b/src/modules/m_spanningtree/netburst.cpp
@@ -276,7 +276,7 @@ void TreeSocket::SendUsers(BurstState& bs)
{
for (const auto& [_, user] : ServerInstance->Users.GetUsers())
{
- if (user->registered != REG_ALL)
+ if (!user->IsFullyConnected())
continue;
this->WriteLine(CommandUID::Builder(user));
diff --git a/src/modules/m_spanningtree/uid.cpp b/src/modules/m_spanningtree/uid.cpp
index 84dae98ef..ccedf8c3c 100644
--- a/src/modules/m_spanningtree/uid.cpp
+++ b/src/modules/m_spanningtree/uid.cpp
@@ -49,7 +49,7 @@ CmdResult CommandUID::HandleServer(TreeServer* remoteserver, CommandBase::Params
// See if there is a nick collision
auto collideswith = ServerInstance->Users.FindNick(params[2]);
- if ((collideswith) && (collideswith->registered != REG_ALL))
+ if (collideswith && !collideswith->IsFullyConnected())
{
// User that the incoming user is colliding with is not fully registered, we force nick change the
// unregistered user to their uuid and tell them what happened