mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-08-27 19:25:31 -05:00
[Chat] Don't tag cards that have no match in the database (#2217)
Took 6 minutes
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user