mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-09 10:39:02 -04:00
Fix broadcasting UID messages to v3 servers.
We have to use the compat layer here as broadcast messages do not go through the command builder.
This commit is contained in:
parent
dafaa684e1
commit
42fdbb7234
@ -102,7 +102,7 @@ public:
|
||||
: public CmdBuilder
|
||||
{
|
||||
public:
|
||||
Builder(User* user, bool real_user);
|
||||
Builder(User* user);
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -114,6 +114,19 @@ void TreeSocket::WriteLine(const std::string& original_line)
|
||||
// SQUERY was introduced in PROTO_INSPIRCD_4; convert to PRIVMSG.
|
||||
line.replace(cmdstart, 6, "PRIVMSG");
|
||||
}
|
||||
else if (irc::equals(command, "UID"))
|
||||
{
|
||||
// :<sid> UID <uuid> <nickchanged> <nick> <host> <dhost> <user> <duser> <ip.string> <signon> <modes> [<modepara>] :<real>
|
||||
// ^^^^^^ New in 1206
|
||||
size_t uuidend = NextToken(line, cmdend);
|
||||
size_t nickchangedend = NextToken(line, uuidend);
|
||||
size_t nickend = NextToken(line, nickchangedend);
|
||||
size_t hostend = NextToken(line, nickend);
|
||||
size_t dhostend = NextToken(line, hostend);
|
||||
size_t userend = NextToken(line, dhostend);
|
||||
if (userend != std::string::npos)
|
||||
line.erase(dhostend, userend - dhostend);
|
||||
}
|
||||
}
|
||||
|
||||
WriteLineInternal(line);
|
||||
|
@ -497,22 +497,7 @@ void ModuleSpanningTree::OnUserConnect(LocalUser* user)
|
||||
if (sslapi)
|
||||
sslapi->GetCertificate(user);
|
||||
|
||||
CommandUID::Builder uid(user, true);
|
||||
CommandUID::Builder olduid(user, false);
|
||||
|
||||
// NOTE: we can't do CommandUID::Builder(user).Broadcast() whilst
|
||||
// we still support the 1205 protocol.
|
||||
for (const auto* server : Utils->TreeRoot->GetChildren())
|
||||
{
|
||||
TreeSocket* socket = server->GetSocket();
|
||||
if (!socket)
|
||||
continue; // Should never happen?
|
||||
|
||||
if (socket->proto_version >= PROTO_INSPIRCD_4)
|
||||
socket->WriteLine(uid);
|
||||
else
|
||||
socket->WriteLine(olduid);
|
||||
}
|
||||
CommandUID::Builder(user).Broadcast();
|
||||
|
||||
if (user->IsOper())
|
||||
CommandOpertype::Builder(user, user->oper).Broadcast();
|
||||
|
@ -282,7 +282,7 @@ void TreeSocket::SendUsers(BurstState& bs)
|
||||
if (!user->IsFullyConnected())
|
||||
continue;
|
||||
|
||||
this->WriteLine(CommandUID::Builder(user, this->proto_version != PROTO_INSPIRCD_3));
|
||||
this->WriteLine(CommandUID::Builder(user));
|
||||
|
||||
if (user->IsOper())
|
||||
this->WriteLine(CommandOpertype::Builder(user, user->oper));
|
||||
|
@ -177,7 +177,7 @@ CmdResult CommandFName::HandleRemote(RemoteUser* src, Params& params)
|
||||
return CmdResult::SUCCESS;
|
||||
}
|
||||
|
||||
CommandUID::Builder::Builder(User* user, bool real_user)
|
||||
CommandUID::Builder::Builder(User* user)
|
||||
: CmdBuilder(TreeServer::Get(user), "UID")
|
||||
{
|
||||
push(user->uuid);
|
||||
@ -185,8 +185,7 @@ CommandUID::Builder::Builder(User* user, bool real_user)
|
||||
push(user->nick);
|
||||
push(user->GetRealHost());
|
||||
push(user->GetDisplayedHost());
|
||||
if (real_user)
|
||||
push(user->GetRealUser());
|
||||
push(user->GetRealUser());
|
||||
push(user->GetDisplayedUser());
|
||||
push(user->GetAddress());
|
||||
push_int(user->signon);
|
||||
|
Loading…
x
Reference in New Issue
Block a user