mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-22 01:25:10 -07:00
[Chat] Render game link buttons (#7135)
* [Chat] Render cockatrice://joingame links in chat as clickable buttons Words starting with cockatrice:// become button-style anchors labelled with the game description, id and server (falling back to id + server for links built without a description). The description is spliced via the multi-arg arg() overloads so a title containing "%…" cannot corrupt the label. Keyboard link access is enabled so the anchors are reachable without a mouse. * [Chat] Fix percent-encoding and scheme gating in game-link chat labels Game descriptions containing '%' were rendered as '%25' in the chat button label because QUrlQuery's default decode leaves %25 untouched. Use QUrl::FullyDecoded for the description item, and restrict the invite-button treatment to cockatrice://joingame links; any other cockatrice:// scheme now falls through to plain text. --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
f466a25893
commit
fe53f9c3eb
2 changed files with 55 additions and 1 deletions
|
|
@ -71,6 +71,7 @@ private:
|
|||
void scrollToBottom();
|
||||
void appendCardTag(QTextCursor &cursor, const QString &cardName);
|
||||
void appendUrlTag(QTextCursor &cursor, QString url);
|
||||
void appendGameLinkTag(QTextCursor &cursor, const QString &url);
|
||||
static QColor getCustomMentionColor();
|
||||
static QColor getCustomHighlightColor();
|
||||
void showSystemPopup(const QString &userName);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue