mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-21 00:55:09 -07:00
Fix offline history usernames getting a leading underscore
The offline fallback used "_" as the level placeholder, producing an href of user://__NAME. The hover handler splits at the first underscore, so interactions targeted a nonexistent "_NAME" user. Use level 0 so offline history entries render as zero-level tags like before.
This commit is contained in:
parent
2ae8c32cb2
commit
69f7ebe452
1 changed files with 2 additions and 1 deletions
|
|
@ -346,7 +346,8 @@ void ChatView::appendMessage(QString message,
|
|||
// against the user list to turn their history entries into full user
|
||||
// tags (correct level, name casing and moderation context menu).
|
||||
QString displayName = sentBy;
|
||||
QString levelMarker = "_"; // placeholder for offline / unknown user level
|
||||
// Offline users have no known level; render them as zero-level tags.
|
||||
QString levelMarker = "0";
|
||||
if (const ServerInfo_User *onlineUser = userListProxy->getOnlineUser(sentBy)) {
|
||||
displayName = QString::fromStdString(onlineUser->name());
|
||||
levelMarker = QString::number(onlineUser->user_level());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue