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; + } + } } }