Singleton class responsible for initiating the process of joining an existing wavelength.
More...
#include <wavelength_joiner.h>
|
| void | authenticationFailed (QString frequency) |
| | Emitted if the join attempt fails due to incorrect or missing password.
|
| |
| void | connectionError (const QString &error_message) |
| | Emitted if an error occurs during the connection or join process.
|
| |
| void | messageReceived (QString frequency, const QString &formatted_message) |
| | Emitted when a regular chat message is received for the joined frequency. Note: This signal seems misplaced here and might be better handled solely by WavelengthMessageProcessor/Service.
|
| |
| void | wavelengthClosed (QString frequency) |
| | Emitted if the WebSocket connection for the wavelength is closed unexpectedly (e.g., after joining).
|
| |
| void | wavelengthJoined (QString frequency) |
| | Emitted when the user successfully joins the specified wavelength.
|
| |
| void | wavelengthLeft (QString frequency) |
| | Emitted when the user explicitly leaves or is disconnected from the active wavelength.
|
| |
|
| JoinResult | JoinWavelength (QString frequency, const QString &password=QString()) |
| | Attempts to join an existing wavelength hosted on the relay server. Checks if the wavelength is already joined or pending registration. Creates a new WebSocket connection, connects signals for connection events, errors, and the join result message. Sends the join request upon successful connection. Manages a keep-alive timer for the connection.
|
| |
Singleton class responsible for initiating the process of joining an existing wavelength.
This class handles connecting to the relay server, sending an authentication/join request for a specific frequency (wavelength), and managing the WebSocket connection. It interacts with WavelengthRegistry, WavelengthConfig, AuthenticationManager, MessageHandler, and WavelengthMessageProcessor. It emits signals indicating success (wavelengthJoined), failure (connectionError, authenticationFailed), or disconnection (wavelengthClosed, wavelengthLeft).
◆ WavelengthJoiner() [1/2]
| WavelengthJoiner::WavelengthJoiner |
( |
QObject * | parent = nullptr | ) |
|
|
inlineexplicitprivate |
Private constructor to enforce the singleton pattern.
- Parameters
-
| parent | Optional parent QObject. |
◆ ~WavelengthJoiner()
| WavelengthJoiner::~WavelengthJoiner |
( |
| ) |
|
|
overrideprivatedefault |
◆ WavelengthJoiner() [2/2]
Deleted copy constructor to prevent copying.
◆ authenticationFailed
| void WavelengthJoiner::authenticationFailed |
( |
QString | frequency | ) |
|
|
signal |
Emitted if the join attempt fails due to incorrect or missing password.
- Parameters
-
| frequency | The frequency identifier for which authentication failed. |
◆ connectionError
| void WavelengthJoiner::connectionError |
( |
const QString & | error_message | ) |
|
|
signal |
Emitted if an error occurs during the connection or join process.
- Parameters
-
| error_message | A description of the error. |
◆ GetInstance()
◆ JoinWavelength()
| JoinResult WavelengthJoiner::JoinWavelength |
( |
QString | frequency, |
|
|
const QString & | password = QString() ) |
Attempts to join an existing wavelength hosted on the relay server. Checks if the wavelength is already joined or pending registration. Creates a new WebSocket connection, connects signals for connection events, errors, and the join result message. Sends the join request upon successful connection. Manages a keep-alive timer for the connection.
- Parameters
-
| frequency | The frequency identifier of the wavelength to join. |
| password | Optional password required to join the wavelength. |
- Returns
- A JoinResult struct indicating immediate success (already joined) or failure (pending), or {true, QString()} if the connection process was initiated. Asynchronous results are communicated via signals.
◆ messageReceived
| void WavelengthJoiner::messageReceived |
( |
QString | frequency, |
|
|
const QString & | formatted_message ) |
|
signal |
Emitted when a regular chat message is received for the joined frequency. Note: This signal seems misplaced here and might be better handled solely by WavelengthMessageProcessor/Service.
- Parameters
-
| frequency | The frequency the message belongs to. |
| formatted_message | The HTML-formatted message string. |
◆ operator=()
Deleted assignment operator to prevent assignment.
◆ wavelengthClosed
| void WavelengthJoiner::wavelengthClosed |
( |
QString | frequency | ) |
|
|
signal |
Emitted if the WebSocket connection for the wavelength is closed unexpectedly (e.g., after joining).
- Parameters
-
| frequency | The frequency identifier of the wavelength whose connection closed. |
◆ wavelengthJoined
| void WavelengthJoiner::wavelengthJoined |
( |
QString | frequency | ) |
|
|
signal |
Emitted when the user successfully joins the specified wavelength.
- Parameters
-
| frequency | The frequency identifier of the joined wavelength. |
◆ wavelengthLeft
| void WavelengthJoiner::wavelengthLeft |
( |
QString | frequency | ) |
|
|
signal |
Emitted when the user explicitly leaves or is disconnected from the active wavelength.
- Parameters
-
| frequency | The frequency identifier of the wavelength that was left. |
The documentation for this class was generated from the following files: