Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
DeckShareUtils Namespace Reference

Shared helpers for creating temporary deck shares. More...

Classes

struct  ShareResponse
 The outcome of a successful share-create response. More...

Functions

QString buildShareLink (const AbstractClient *client, const QString &token)
 Builds the cockatrice:// link for a freshly created deck share.
QString copyShareLinkToClipboard (const QString &link)
 Copies the share link to the clipboard.
QString formatShareExpiry (const QDateTime &expiry)
 Formats the expiration timestamp for a share.
ShareResponse handleShareResponse (const AbstractClient *client, const Response &response)
 Handles a successful Response_DeckShareCreate: builds the share link, copies it to the clipboard, and derives the share expiry.

Detailed Description

Shared helpers for creating temporary deck shares.

Function Documentation

◆ buildShareLink()

QString DeckShareUtils::buildShareLink ( const AbstractClient * client,
const QString & token )

Builds the cockatrice:// link for a freshly created deck share.

Parameters
clientUsed to embed the target server's hostname and port.
tokenThe share token from Response_DeckShareCreate.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ copyShareLinkToClipboard()

QString DeckShareUtils::copyShareLinkToClipboard ( const QString & link)

Copies the share link to the clipboard.

Returns
The link that was copied.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ formatShareExpiry()

QString DeckShareUtils::formatShareExpiry ( const QDateTime & expiry)

Formats the expiration timestamp for a share.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleShareResponse()

ShareResponse DeckShareUtils::handleShareResponse ( const AbstractClient * client,
const Response & response )

Handles a successful Response_DeckShareCreate: builds the share link, copies it to the clipboard, and derives the share expiry.

Parameters
clientUsed to embed the target server's hostname and port.
responseThe successful response carrying the share token and expiry.
Here is the call graph for this function:
Here is the caller graph for this function: