From 24d780e669d508fc2850e2f140a9a9bd1368eeec Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 13 Feb 2026 19:42:42 -0800 Subject: [PATCH] Fix chat sender names via name queries --- src/game/game_handler.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index c1081ef6..4a03f5bc 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -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(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; + } + } } }