• DiscoveryCore
  • DiscoveryCore Class

    Performs low-level HTTP discovery and JSON parsing. More...

    Header: #include <DiscoveryCore>
    Inherits: QObject

    Public Functions

    DiscoveryCore(QObject *parent = nullptr)
    void fetchServerMeta(const QUrl &url)

    Detailed Description

    DiscoveryCore is responsible for making an HTTP GET request to a chat server's discovery endpoint, parsing the JSON response into a DiscoveryPayload, and emitting the result via signals. Only one request is active at any time; repeated calls cancel the previous one.

    Internal Members

    These members are maintained internally by DiscoveryCore and are not intended for external use. They are documented here for developer clarity.

    Private Variables

    • m_accessManager (QNetworkAccessManager) – Handles asynchronous HTTP requests for discovery.
    • m_currentReply (QNetworkReply*) – Tracks the active network request so it can be canceled or cleared.

    Internal Functions

    • handleReply() – Processes the HTTP response and emits either a success or error signal.
    • clearCurrentReply() – Resets and cleans up the current network reply.

    See also DiscoveryPayload and DiscoveryPage.

    Member Function Documentation

    [explicit] DiscoveryCore::DiscoveryCore(QObject *parent = nullptr)

    Constructs the DiscoveryCore.

    parent is the optional parent object for ownership and signal propagation.

    void DiscoveryCore::fetchServerMeta(const QUrl &url)

    Initiates a discovery request to the given url.

    Cancels any previous request in progress. Emits success with a parsed DiscoveryPayload on success or error with a descriptive message on failure.

    See also DiscoveryPayload.