mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
Fix chat sender names via name queries
This commit is contained in:
parent
5afd1b65a8
commit
24d780e669
1 changed files with 12 additions and 0 deletions
|
|
@ -3739,6 +3739,11 @@ void GameHandler::handleMessageChat(network::Packet& packet) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If still unknown, proactively query the server so the UI can show names soon after.
|
||||
if (data.senderName.empty()) {
|
||||
queryPlayerName(data.senderGuid);
|
||||
}
|
||||
}
|
||||
|
||||
// Add to chat history
|
||||
|
|
@ -4825,6 +4830,13 @@ void GameHandler::handleNameQueryResponse(network::Packet& packet) {
|
|||
auto player = std::static_pointer_cast<Player>(entity);
|
||||
player->setName(data.name);
|
||||
}
|
||||
|
||||
// Backfill chat history entries that arrived before we knew the name.
|
||||
for (auto& msg : chatHistory) {
|
||||
if (msg.senderGuid == data.guid && msg.senderName.empty()) {
|
||||
msg.senderName = data.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue