mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-29 17:32:17 -07:00
* [Client] Confirm before joining a game opened from a game link Joining a game from a cockatrice://joingame link is a navigation decision, so restate what will be joined and ask before acting: the confirm names the game description when the link carries one (falling back to the room name and numeric id for older links), and reports the host:port so links that point at a different server are obvious. The intent chain is only started after confirmation. Took 3 minutes * [Client] Extract the join-game confirm message into a helper Took 3 minutes # Commit time for manual adjustment: # Took 6 seconds * Proper fwd declare. Took 3 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
23 lines
539 B
C++
23 lines
539 B
C++
#ifndef COCKATRICE_URL_PARSER_H
|
|
#define COCKATRICE_URL_PARSER_H
|
|
#include <QObject>
|
|
#include <QUrlQuery>
|
|
|
|
class MainWindow;
|
|
struct ContextJoinGame;
|
|
class IntentUrlParser : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
IntentUrlParser(QObject *parent, MainWindow *mainWindow);
|
|
void handle(const QString &urlStr);
|
|
void handleJoinGame(const QUrlQuery &query);
|
|
|
|
private:
|
|
QString generateJoinGameMessage(const ContextJoinGame &context, const QString &gameDescription);
|
|
|
|
MainWindow *mainWindow;
|
|
};
|
|
|
|
#endif // COCKATRICE_URL_PARSER_H
|