mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-28 00:42:19 -07:00
[Chat] Don't tag cards that have no match in the database (#2217)
Took 6 minutes Took 4 minutes
This commit is contained in:
parent
c4316c40e9
commit
2580d23a6f
1 changed files with 6 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue