This commit is contained in:
BruebachL 2026-08-05 09:52:11 -07:00 committed by GitHub
commit 6f7d2af698
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,6 +13,7 @@
#include <QDesktopServices>
#include <QMouseEvent>
#include <QScrollBar>
#include <libcockatrice/card/database/card_database_manager.h>
#include <libcockatrice/network/server/remote/user_level.h>
#include <libcockatrice/settings/chat_settings.h>
@ -172,6 +173,11 @@ void ChatView::appendHtmlServerMessage(const QString &html, bool optionalIsBold,
void ChatView::appendCardTag(QTextCursor &cursor, const QString &cardName)
{
if (!CardDatabaseManager::query()->lookupCardByName(cardName)) {
cursor.insertText(cardName);
return;
}
QTextCharFormat oldFormat = cursor.charFormat();
QTextCharFormat anchorFormat = oldFormat;
anchorFormat.setForeground(linkColor);