### Install libQuotient with CMake Source: https://quotient-im.github.io/libQuotient/index.html Command to install the library and its package configuration files to the system. ```bash cmake --build . --target install ``` -------------------------------- ### startVerification() Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Room.html Starts verification for the room. ```APIDOC ## startVerification() ### Description Starts verification for the room. ### Method startVerification ### Parameters None. ``` -------------------------------- ### startSas() Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1KeyVerificationSession.html Starts a SAS verification. ```APIDOC ## startSas() ### Description Starts a SAS verification. ### Method startSas ### Signature Q_INVOKABLE void Quotient::KeyVerificationSession::startSas() ``` -------------------------------- ### startMonitoring() Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1KeyVerificationSession.html Starts monitoring the verification session. ```APIDOC ## startMonitoring() ### Description Starts monitoring the verification session. ### Method startMonitoring ### Signature void Quotient::KeyVerificationSession::startMonitoring() ``` -------------------------------- ### GET /_matrix/client/v1/media/config Source: https://quotient-im.github.io/libQuotient/content-repo_8h_source.html Get the configuration for the content repository. ```APIDOC ## [GET] /_matrix/client/v1/media/config ### Description Get the configuration for the content repository. ### Method GET ### Endpoint /_matrix/client/v1/media/config ### Parameters None ### Response #### Success Response (200) - **m.upload.size** (integer) - The maximum size an upload can be in bytes. #### Response Example { "m.upload.size": 10485760 } ``` -------------------------------- ### GET /_matrix/client/v1/media/url_preview Source: https://quotient-im.github.io/libQuotient/content-repo_8h_source.html Get information about a URL for a client. ```APIDOC ## [GET] /_matrix/client/v1/media/url_preview ### Description Get information about a URL for a client. ### Method GET ### Endpoint /_matrix/client/v1/media/url_preview ### Parameters #### Query Parameters - **url** (string) - Required - The URL to get a preview for. - **ts** (integer) - Optional - The timestamp to use for the preview. ### Response #### Success Response (200) - **og_image** (string) - The URL of the image to use in the preview. - **matrix_image_size** (integer) - The size of the image in bytes. #### Response Example { "og_image": "mxc://example.com/abc", "matrix_image_size": 12345 } ``` -------------------------------- ### run (JobHandle) Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Connection.html Start a pre-created job on this connection. ```APIDOC ## run (JobHandle) ### Description Start a pre-created job on this connection. ### Method template JobT> requires (!std::same_as) JobHandle run(JobHandle &&job, RunningPolicy runningPolicy = ForegroundRequest) ### Parameters - job (JobHandle &&) - The job handle to run. - runningPolicy (RunningPolicy) - Optional. The running policy. Default is ForegroundRequest. ### Returns JobHandle - The job handle. ``` -------------------------------- ### JobHandle deduction guide Source: https://quotient-im.github.io/libQuotient/jobhandle_8h_source.html Deduction guide for JobHandle from a BaseJob pointer. ```cpp template JobT> JobHandle(JobT*) -> JobHandle; ``` -------------------------------- ### startKeyVerificationSession Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Connection.html Start a key verification session with a user and device. ```APIDOC ## startKeyVerificationSession ### Description Start a key verification session with a user and device. ### Method Quotient::KeyVerificationSession * startKeyVerificationSession(const QString &userId, const QString &deviceId) ### Parameters - **userId** (QString) - Required - The user ID. - **deviceId** (QString) - Required - The device ID. ### Returns Quotient::KeyVerificationSession* - A pointer to the verification session. ``` -------------------------------- ### syncLoop Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Connection.html Start a continuous sync loop with the homeserver. ```APIDOC ## syncLoop ### Description Start a continuous sync loop with the homeserver. ### Method void syncLoop(int timeout=SyncJob::defaultTimeoutMillis) ### Parameters - **timeout** (int) - Optional - Timeout in milliseconds, defaults to SyncJob::defaultTimeoutMillis. ``` -------------------------------- ### run (BaseJob) Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Connection.html Start a pre-made job object on this connection. ```APIDOC ## run (BaseJob) ### Description Start a pre-made job object on this connection. ### Method Q_INVOKABLE void run(Quotient::BaseJob *job, Quotient::RunningPolicy runningPolicy = Quotient::ForegroundRequest) ### Parameters - job (Quotient::BaseJob *) - The job to run. - runningPolicy (Quotient::RunningPolicy) - Optional. The running policy. Default is ForegroundRequest. ### Returns void ``` -------------------------------- ### KeyVerificationSession::startSas() Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1KeyVerificationSession.html Starts a SAS (Short Authentication String) verification. ```APIDOC ## startSas() ### Description Starts a SAS verification. ### Method Q_INVOKABLE void ### Parameters None ### Return Value void ``` -------------------------------- ### newSession Source: https://quotient-im.github.io/libQuotient/room_8h_source.html Starts a new session for the room. ```APIDOC ## newSession ### Description Starts a new session for the room. ### Method newSession ### Parameters - **newSession** (const QString&) - Required - The new session identifier. ``` -------------------------------- ### instance Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1NetworkAccessManager.html Get a NAM instance for the current thread. ```APIDOC ## instance ### Description Get a NAM instance for the current thread. ### Method static NetworkAccessManager * ### Signature static NetworkAccessManager * instance() ### Parameters None ### Returns NetworkAccessManager * - A pointer to the NetworkAccessManager instance for the current thread. ``` -------------------------------- ### startSelfVerification() Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Connection-members.html Starts self verification. This is a slot that can be called directly. ```APIDOC ## startSelfVerification() n ### Description Starts self verification. ### Method slot ### Parameters None. ``` -------------------------------- ### creatorIds() Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Room.html Gets Matrix IDs for room creator(s). The list starts with the MXID of the room creation event sender, and may include additional creators for room versions 12 and newer. ```APIDOC ## creatorIds() ### Description Get Matrix IDs for room creator(s). As long as the create event for the room is known, the returned list will start with MXID of the room creation event sender. For room versions 12 and newer, the returned list will further include additional creators if there are any. ### Method QStringList Quotient::Room::creatorIds() const ### Parameters None ### Returns QStringList - List of Matrix IDs for room creators. ``` -------------------------------- ### NetworkSettings::setupApplicationProxy() Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1NetworkSettings.html Sets up the application proxy based on the current network settings. This method is invokable from QML and is const. ```APIDOC ## NetworkSettings::setupApplicationProxy() ### Description Sets up the application proxy based on the current network settings. This method is invokable from QML and is const. ### Method setupApplicationProxy ### Signature Q_INVOKABLE void Quotient::NetworkSettings::setupApplicationProxy() const ### Parameters None ### Return Value void ``` -------------------------------- ### prepareForSso Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Connection.html Start a local HTTP server and generate a single sign-on URL. ```APIDOC ## prepareForSso ### Description Start a local HTTP server and generate a single sign-on URL. ### Method Q_INVOKABLE SsoSession * prepareForSso(const QString &initialDeviceName, const QString &deviceId = {}) ### Parameters - initialDeviceName (QString) - The initial device name. - deviceId (QString) - Optional. The device ID. ### Returns SsoSession * - The SSO session object. ``` -------------------------------- ### Quotient::Overloads deduction guide Source: https://quotient-im.github.io/libQuotient/util_8h.html Deduction guide for the Overloads type. ```APIDOC ## Deduction Guide: Quotient::Overloads ### Description Deduction guide for the Overloads class template. ### Signature template Quotient::Overloads(FunctorTs&&...) -> Overloads ``` -------------------------------- ### NetworkSettings::setupApplicationProxy Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1NetworkSettings.html Sets up the application proxy based on the current network settings. This method is invokable from QML and takes no parameters. ```APIDOC ## setupApplicationProxy ### Description Sets up the application proxy based on the current network settings. ### Method Q_INVOKABLE void ### Signature `Q_INVOKABLE void setupApplicationProxy() const` ### Parameters None. ### Return Value None. ``` -------------------------------- ### initiate(Quotient::ConnectionData *connData, bool inBackground) Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1BaseJob.html Initiates the job with the given connection data. This is a public slot that starts the job execution. ```APIDOC ## initiate(Quotient::ConnectionData *connData, bool inBackground) ### Description Initiates the job with the given connection data. This is a public slot that starts the job execution. ### Method Slot ### Signature void initiate(Quotient::ConnectionData *connData, bool inBackground) ### Parameters - **connData** (Quotient::ConnectionData*) - Required - The connection data for the job. - **inBackground** (bool) - Required - Whether the job should run in the background. ``` -------------------------------- ### begin() Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1AccountRegistry.html Returns an iterator to the beginning of the account list. ```APIDOC ## begin() ### Description Returns an iterator to the beginning of the account list. ### Method Member function ### Signature const_iterator begin() const ### Returns - **const_iterator** - Iterator to the first element. ``` -------------------------------- ### Deduction guides for BoundFn Source: https://quotient-im.github.io/libQuotient/jobhandle_8h_source.html Deduction guides for BoundFn to allow construction from rvalue and lvalue references. ```cpp template BoundFn(FnT&&) -> BoundFn; template BoundFn(const FnT &) -> BoundFn; ``` -------------------------------- ### template get() const Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1RoomStateView.html Template method to get a keyless state event of a specific type. ```APIDOC ## template get() const ### Description Gets a keyless state event of the template type EvT. ### Return Value - **const EvT *** - Pointer to the state event, or nullptr if not found. ``` -------------------------------- ### Migration example: combine success and failure with then() Source: https://quotient-im.github.io/libQuotient/jobhandle_8h_source.html Shows how to use then() with two lambdas for success and failure handling, replacing separate connections to BaseJob::success and BaseJob::failure. ```cpp callApi(jobParams...).then([this] { /* on success... */ }, [this] { /* on failure... */ }); ``` -------------------------------- ### template get(const QString &stateKey={}) const Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1RoomStateView.html Template method to get a state event of a specific type with a given state key. ```APIDOC ## template get(const QString &stateKey={}) const ### Description Gets a state event of the template type EvT with the given state key. ### Parameters - **stateKey** (QString) - Optional state key. Defaults to empty string. ### Return Value - **const EvT *** - Pointer to the state event, or nullptr if not found. ``` -------------------------------- ### run(JobHandle&& job, RunningPolicy runningPolicy) Source: https://quotient-im.github.io/libQuotient/connection_8h_source.html Starts a pre-created job on this connection. Use this overload if you have a job object pre-made with JobHandle<>::createFrom() when you need to actually start (or rather, queue) the network request. It is strongly recommended to use the job handle returned by run() instead of the original, as run() may (in the future) attach continuations to the future interface of the handle. ```APIDOC ## run(JobHandle&& job, RunningPolicy runningPolicy) ### Description Starts a pre-created job on this connection. Use this overload if you have a job object pre-made with JobHandle<>::createFrom() when you need to actually start (or rather, queue) the network request. It is strongly recommended to use the job handle returned by run() instead of the original, as run() may (in the future) attach continuations to the future interface of the handle. ### Method template JobT> requires (!std::same_as) JobHandle run(JobHandle&& job, RunningPolicy runningPolicy = ForegroundRequest); ### Parameters - **job** (JobHandle&&) - Required - The job handle to start. - **runningPolicy** (RunningPolicy) - Optional - Controls how the job is executed. Default is ForegroundRequest. ### Returns JobHandle - The job handle for the started job. ``` -------------------------------- ### Quotient::BaseJob - initiate() Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1GetContentOverrideNameJob.html Initiates the job with connection data and background execution flag. ```APIDOC ### void initiate(Quotient::ConnectionData *connData, bool inBackground) #### Description Initiates the job with the given connection data. If inBackground is true, the job runs in the background without interactive UI. #### Parameters - **connData** (Quotient::ConnectionData*) - Required - Pointer to connection data. - **inBackground** (bool) - Required - Indicates if the job should run in background. ``` -------------------------------- ### RoomStateView class definition with type-safe get() overloads Source: https://quotient-im.github.io/libQuotient/roomstateview_8h_source.html Defines the RoomStateView class, which inherits from QHash. It provides type-safe get() overloads for keyed and keyless state events, using concepts Keyed_State_Fn and Keyless_State_Fn. The get() methods return nullptr if the event is not found, and assert that the event type and state key match. ```cpp template >> concept Keyed_State_Fn = EvT::needsStateKey; template >> concept Keyless_State_Fn = !EvT::needsStateKey; class QUOTIENT_API RoomStateView : private QHash { Q_GADGET public: const QHash& events() const { return *this; } //! \brief Get a state event with the given event type and state key //! \return A state event corresponding to the pair of event type //! \p evtType and state key \p stateKey, or `nullptr` if there's //! no such \p evtType / \p stateKey combination in the current //! state. //! \warning The returned value is not guaranteed to be non-`nullptr`; you //! MUST check it before using or use other methods of this class //! such as query() and content() to access state safely. //! \sa content, contentJson, query const StateEvent* get(const QString& evtType, const QString& stateKey = {}) const; //! \brief Get a state event with the given event type and state key //! //! This is a typesafe overload that accepts a C++ event type instead of //! its Matrix name. It is only defined for events with state key (i.e., //! derived from KeyedStateEvent). template const EvT* get(const QString& stateKey = {}) const { if (const auto* evt = get(EvT::TypeId, stateKey)) { Q_ASSERT(evt->matrixType() == EvT::TypeId && evt->stateKey() == stateKey); return eventCast(evt); } return nullptr; } //! \brief Get a state event with the given event type //! //! This is a typesafe overload that accepts a C++ event type instead of //! its Matrix name. This overload only defined for events that do not use //! state key (i.e., derived from KeylessStateEvent). template const EvT* get() const { if (const auto* evt = get(EvT::TypeId)) { Q_ASSERT(evt->matrixType() == EvT::TypeId); return eventCast(evt); } return nullptr; } using QHash::contains; bool contains(const QString& evtType, const QString& stateKey = {}) const; template bool contains(const QString& stateKey = {}) const { return contains(EvT::TypeId, stateKey); } template bool contains() const { return contains(EvT::TypeId); } template auto content(const QString& stateKey, typename EvT::content_type defaultValue = {}) const { // EventBase<>::content is special in that it returns a const-ref, // and lift() inside queryOr() can't wrap that in a temporary optional. if (const auto evt = get(stateKey)) return evt->content(); return std::move(defaultValue); } template auto content(typename EvT::content_type defaultValue = {}) const { // Same as above if (const auto evt = get()) return evt->content(); return defaultValue; } //! \brief Get the content of the current state event with the given //! event type and state key //! \return An empty object if there's no event in the current state with //! this event type and state key; the contents of the event //! 'content' object otherwise Q_INVOKABLE QJsonObject contentJson(const QString& evtType, const QString& stateKey = {}) const; //! \brief Get all state events in the room of a certain type //! //! This function allows to retrieve all events of one type regardless of their state key. //! \note To do its job, the function has to look through the entire list of state events //! currently in the room; this may have implications in performance-sensitive code. //! \return all known state events of \p evtType that have occurred in the room QVector eventsOfType(const QString& evtType) const; //! \brief Get all state events in the room of a certain type //! //! This is a type-safe overload for the case when the event type is known at compile time. //! \note This overload is only defined for event types that expect a state key. //! \note Same as the other overload, this one has to look through the entire list of state //! events, although it is slightly faster thanks to the event type known at compile time. //! \return all known state events of type \p EvT that have occurred in the room template QVector eventsOfType() const { using namespace std::ranges::views; return rangeTo(filter(*this, &Event::is) | transform([](const StateEvent* e) { return static_cast(e); })); } //! \brief Run a function on a state event with the given type and key //! ``` -------------------------------- ### get() [3/3] - Typesafe state event retrieval Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1RoomStateView.html Typesafe overload of get() that accepts a C++ event type instead of its Matrix name. Only defined for events with state key (derived from KeyedStateEvent). ```APIDOC ## get() [3/3] ### Description Get a state event with the given event type and state key. This is a typesafe overload that accepts a C++ event type instead of its Matrix name. It is only defined for events with state key (i.e., derived from KeyedStateEvent). ### Method template const EvT * Quotient::RoomStateView::get(const QString &stateKey = {}) const ### Parameters - **stateKey** (const QString &) - Optional - The state key. Defaults to an empty string. ### Returns A pointer to the state event of type EvT, or nullptr if not found. ### Definition Definition at line 52 of file roomstateview.h. ``` -------------------------------- ### prepareForSso(const QString &initialDeviceName, const QString &deviceId={}) Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Connection-members.html Prepares for Single Sign-On (SSO) login. This is a method that can be called directly. ```APIDOC ## prepareForSso(const QString &initialDeviceName, const QString &deviceId={}) ### Description Prepares for Single Sign-On (SSO) login. ### Method method ### Parameters - **initialDeviceName** (QString) - Required - The initial device name. - **deviceId** (QString) - Optional - The device ID, defaults to empty. ``` -------------------------------- ### id Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Room.html Get the room ID. ```APIDOC ## id ### Description Get the room ID. ### Method const ### Returns const QString & - The room ID. ``` -------------------------------- ### tag Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Room.html Gets a tag by name. ```APIDOC ## tag ### Description Gets a tag by name. ### Method Tag tag(const QString &name) const ### Parameters - **name** (QString) - Required - The tag name. ### Returns Tag - The tag data. ``` -------------------------------- ### tags Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Room.html Gets the tags map. ```APIDOC ## tags ### Description Gets the tags map. ### Method TagsMap tags() const ### Returns TagsMap - The tags map. ``` -------------------------------- ### startKeyVerificationSession(const QString &userId, const QString &deviceId) Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Connection-members.html Starts a key verification session. This is a slot that can be called directly. ```APIDOC ## startKeyVerificationSession(const QString &userId, const QString &deviceId) ### Description Starts a key verification session. ### Method slot ### Parameters - **userId** (QString) - Required - The user ID. - **deviceId** (QString) - Required - The device ID. ``` -------------------------------- ### get() [1/3] Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1RoomStateView.html Type-safe overload to get a state event with the given event type, accepting a C++ event type instead of its Matrix name. Only defined for events that do not use a state key (derived from KeylessStateEvent). ```APIDOC ## get() [1/3] ### Description Get a state event with the given event type. This is a typesafe overload that accepts a C++ event type instead of its Matrix name. Only defined for events that do not use state key (i.e., derived from KeylessStateEvent). ### Method template const EvT * get() const ### Returns A pointer to the state event of type EvT, or nullptr if not found. ### Definition Line 68 of roomstateview.h. ``` -------------------------------- ### BaseJob::doPrepare Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1ReportContentJob.html Prepare the job for execution. ```APIDOC ## BaseJob::doPrepare ### Description Prepare the job for execution. ### Method virtual void doPrepare(const ConnectionData *) ### Parameters - **ConnectionData*** - Required - The connection data. ### Response No return value. ``` -------------------------------- ### currentState Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Room.html Gets the current room state. ```APIDOC ## currentState ### Description Gets the current room state. ### Method RoomStateView currentState() const ### Returns RoomStateView - The current room state. ``` -------------------------------- ### void AccountSettings::setHomeserver(const QUrl &_url_) Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1AccountSettings.html Sets the homeserver URL to the given QUrl value. ```APIDOC ## void AccountSettings::setHomeserver(const QUrl &_url_) ### Description Sets the homeserver URL to the given QUrl value. ### Parameters - **url** (const QUrl &) - Required - The homeserver URL to set. ### Return Type void ``` -------------------------------- ### fileTransferInfo Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Room.html Gets information on file upload/download. ```APIDOC ## fileTransferInfo ### Description Gets information on file upload/download. ### Method Q_INVOKABLE Quotient::FileTransferInfo fileTransferInfo(const QString &id) const ### Parameters - **id** (QString) - Required - The file transfer ID. ### Returns Quotient::FileTransferInfo - The file transfer information. ``` -------------------------------- ### joinRoom(Connection *account, const QString &roomAliasOrId, const QStringList &viaServers={}) Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1UriResolverBase.html Called by visitResource() to join a room. Override to customize room joining behavior. ```APIDOC ## joinRoom(Connection *account, const QString &roomAliasOrId, const QStringList &viaServers={}) ### Description Called by visitResource() to join a room. Override to customize room joining behavior. ### Method joinRoom ### Signature `virtual void joinRoom(Connection *account, const QString &roomAliasOrId, const QStringList &viaServers={})` ### Parameters - **account** (Connection*) - Required - The connection to use for joining. - **roomAliasOrId** (const QString&) - Required - The room alias or ID to join. - **viaServers** (const QStringList&) - Optional - List of servers to use for joining. ``` -------------------------------- ### tagNames Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Room.html Gets the list of tag names. ```APIDOC ## tagNames ### Description Gets the list of tag names. ### Method QStringList tagNames() const ### Returns QStringList - The list of tag names. ``` -------------------------------- ### notificationFor Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Room.html Gets notification details for an event. ```APIDOC ## notificationFor ### Description Gets notification details for an event. ### Method Notification notificationFor(const TimelineItem &ti) const ### Parameters - **ti** (TimelineItem) - Required - The timeline item to get notification details for. ### Returns Notification - The notification details for the event. ``` -------------------------------- ### run(Quotient::BaseJob* job, Quotient::RunningPolicy runningPolicy) Source: https://quotient-im.github.io/libQuotient/connection_8h_source.html Starts a pre-made job object on this connection. Use this overload when you don't want to, or cannot, use JobHandle. Internally, this is also the function all other template wrappers ultimately call to do the real work. ```APIDOC ## run(Quotient::BaseJob* job, Quotient::RunningPolicy runningPolicy) ### Description Starts a pre-made job object on this connection. Use this overload when you don't want to, or cannot, use JobHandle. Internally, this is also the function all other template wrappers ultimately call to do the real work. ### Method Q_INVOKABLE void run(Quotient::BaseJob* job, Quotient::RunningPolicy runningPolicy = Quotient::ForegroundRequest); ### Parameters - **job** (Quotient::BaseJob*) - Required - The job object to start. - **runningPolicy** (Quotient::RunningPolicy) - Optional - Controls how the job is executed. Default is Quotient::ForegroundRequest. ``` -------------------------------- ### RoomEvent::relationsToThis Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1RedactionEvent.html Get relations to this event. ```APIDOC ## RoomEvent::relationsToThis ### Description Get relations to this event. ### Method relationsToThis ### Signature QJsonObject relationsToThis() const ### Returns - **QJsonObject** - The relations to this event. ``` -------------------------------- ### prepareForSso() : Quotient::Connection Source: https://quotient-im.github.io/libQuotient/functions_p.html Prepares the connection for SSO authentication. ```APIDOC ## prepareForSso() ### Description Prepares the connection for SSO authentication. ### Returns Quotient::Connection ``` -------------------------------- ### Build libQuotient with CMake Source: https://quotient-im.github.io/libQuotient/index.html Standard commands to configure and build the library from the project root directory. ```bash cmake -B build -S . # [-D=...], see below cmake --build build --target all ``` -------------------------------- ### userFactory Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Connection.html Gets a user factory function. ```APIDOC ## userFactory ### Description Gets a user factory function. ### Method static user_factory_t ### Returns - **user_factory_t** - The current user factory function. ``` -------------------------------- ### Quotient::BaseJob - doPrepare() Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1GetContentOverrideNameJob.html Virtual method called to prepare the job for execution. ```APIDOC ### virtual void doPrepare(const ConnectionData *) #### Description Prepare the job for execution. Override to make the job ready. ``` -------------------------------- ### timeToRetry() Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1BaseJob.html Method to get the time to retry. ```APIDOC ## timeToRetry() ### Description Method to get the time to retry. ### Method const ### Signature std::chrono::milliseconds Quotient::BaseJob::timeToRetry() const ``` -------------------------------- ### getThumbnail (url) Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Connection.html Get a thumbnail for a URL. ```APIDOC ## getThumbnail (url) ### Description Get a thumbnail for a URL. ### Method JobHandle getThumbnail(const QUrl &url, QSize requestedSize, RunningPolicy policy=BackgroundRequest) ### Parameters - **url** (QUrl) - Required - The URL of the media. - **requestedSize** (QSize) - Required - The requested thumbnail size. - **policy** (RunningPolicy) - Optional - The running policy, defaults to BackgroundRequest. ### Returns JobHandle - A job handle for the thumbnail request. ``` -------------------------------- ### PostRoomKeysVersionJob constructor Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1PostRoomKeysVersionJob.html Creates a new backup. The constructor takes the algorithm used for storing backups and algorithm-dependent authentication data. ```APIDOC ## PostRoomKeysVersionJob(const QString &_algorithm_, const QJsonObject &_authData_) ### Description Creates a new backup. ### Parameters - **algorithm** (const QString&) - Required - The algorithm used for storing backups. - **authData** (const QJsonObject&) - Required - Algorithm-dependent data. See the documentation for the backup algorithms in Server-side key backups for more information on the expected format of the data. ``` -------------------------------- ### get() Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1EventItemBase.html Returns a pointer to the underlying RoomEvent. ```APIDOC ## get() ### Description Returns a const pointer to the underlying RoomEvent. ### Method const RoomEvent* get() const ### Returns - **const RoomEvent*** - Pointer to the underlying event. ``` -------------------------------- ### Quotient::JoinRoomByIdJob::JoinRoomByIdJob Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1JoinRoomByIdJob.html Constructor that starts the requesting user participating in a particular room. Requires a room ID, not an alias. Optionally accepts a third-party signed invite and a reason. ```APIDOC ## Constructor: Quotient::JoinRoomByIdJob::JoinRoomByIdJob ### Description Starts the requesting user participating in a particular room. This API requires a room ID, not an alias. After joining, the client can see all current state events and subsequent events until the user leaves. ### Signature ```cpp Quotient::JoinRoomByIdJob::JoinRoomByIdJob( const QString &_roomId_, const std::optional &_thirdPartySigned_ = std::nullopt, const QString &_reason_ = {} ) ``` ### Parameters - **roomId** (QString) - Required - The room identifier (not alias) to join. - **thirdPartySigned** (std::optional) - Optional - If supplied, the homeserver must verify that it matches a pending m.room.third_party_invite event in the room, and perform key validity checking if required by the event. - **reason** (QString) - Optional - Optional reason to be included as the reason on the subsequent membership event. ``` -------------------------------- ### Quotient::JoinRoomJob Source: https://quotient-im.github.io/libQuotient/joining_8h.html Start the requesting user participating in a particular room by its alias. ```APIDOC ## Quotient::JoinRoomJob ### Description Start the requesting user participating in a particular room by its alias. ### Class Quotient::JoinRoomJob ### Namespace Quotient ### Usage This class is used to join a room by its alias. ### Related Functions - `Quotient::collectResponse(const JoinRoomJob *job)` - Collects the response from the job. ``` -------------------------------- ### collectResponse Source: https://quotient-im.github.io/libQuotient/namespaceQuotient.html Gets a job response in a single structure. ```APIDOC ## collectResponse ### Description Gets a job response in a single structure. ### Function Signature template JobT> requires requires { doCollectResponse(job); } auto collectResponse(JobT *job) ### Parameters - **job** (JobT*) - The job to collect response from. ### Returns auto - The collected response. ``` -------------------------------- ### doPrepare Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1BaseJob.html Virtual protected member function that prepares the job for execution. ```APIDOC ## doPrepare ### Description Prepare the job for execution. ### Signature ```cpp virtual void doPrepare(const ConnectionData*) ``` ### Parameters - **ConnectionData*** - The connection data. ``` -------------------------------- ### userId Source: https://quotient-im.github.io/libQuotient/connection_8h_source.html Gets the current user's ID. ```APIDOC ## userId ### Description Gets the current user's ID. ### Method QString userId() const ### Returns QString - The current user's ID. ``` -------------------------------- ### Connection() [2/2] Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Connection.html Constructs a Connection object with a specified server URL and an optional parent QObject. ```APIDOC ## Connection() [2/2] ### Description Constructs a Connection object with a specified server URL and an optional parent QObject. ### Signature `explicit Quotient::Connection::Connection(const QUrl &server, QObject *parent = nullptr)` ### Parameters - **server** (const QUrl&) - Required - The URL of the Matrix homeserver. - **parent** (QObject*) - Optional - Parent QObject for ownership. ``` -------------------------------- ### joinRule Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Room.html Gets the current Join Rule for the room. ```APIDOC ## joinRule ### Description Gets the current Join Rule for the room. ### Method JoinRule joinRule() const ### Returns JoinRule - The current join rule. ``` -------------------------------- ### urlToDownload Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Room.html Gets the URL to download the given event. ```APIDOC ## urlToDownload ### Description Gets the URL to download the given event. ### Method Q_INVOKABLE QUrl urlToDownload(const QString &eventId) const ### Parameters - **eventId** (QString) - Required - The event ID. ### Returns QUrl - The download URL. ``` -------------------------------- ### SyncData::takeDevicesList() Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1SyncData.html Returns the devices list. ```APIDOC ## SyncData::takeDevicesList() ### Description Returns the devices list. ### Syntax ```cpp DevicesList Quotient::SyncData::takeDevicesList() ``` ### Parameters None. ### Returns - **DevicesList** - The devices list. ``` -------------------------------- ### urlToThumbnail Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Room.html Gets the URL to the thumbnail for the given event. ```APIDOC ## urlToThumbnail ### Description Gets the URL to the thumbnail for the given event. ### Method Q_INVOKABLE QUrl urlToThumbnail(const QString &eventId) const ### Parameters - **eventId** (QString) - Required - The event ID. ### Returns QUrl - The thumbnail URL. ``` -------------------------------- ### instance Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1NetworkAccessManager-members.html Returns the singleton instance of the network access manager. ```APIDOC ## instance ### Description Returns the singleton instance of the network access manager. ### Method static ### Signature `static NetworkAccessManager* instance()` ### Parameters None. ### Return Value NetworkAccessManager* - The singleton instance. ``` -------------------------------- ### PostRoomKeysVersionJob(const QString &algorithm, const QJsonObject &authData) Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1PostRoomKeysVersionJob.html Constructs a job to create a new server-side backup version for room keys. The algorithm and authentication data are required parameters. ```APIDOC ## PostRoomKeysVersionJob(const QString &algorithm, const QJsonObject &authData) ### Description Constructs a job to create a new server-side backup version for room keys. ### Constructor PostRoomKeysVersionJob(const QString &algorithm, const QJsonObject &authData) ### Parameters - **algorithm** (QString) - Required - The algorithm used for the backup. - **authData** (QJsonObject) - Required - Authentication data for the backup. ``` -------------------------------- ### lastReadReceipt Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Room.html Gets the latest read receipt from a user. ```APIDOC ## lastReadReceipt ### Description Gets the latest read receipt from a user. ### Method ReadReceipt lastReadReceipt(const QString &userId) const ### Parameters - **userId** (QString) - Required - The user ID to get the read receipt for. ### Returns ReadReceipt - The latest read receipt from the user. ``` -------------------------------- ### Uri(QByteArray primaryId, QByteArray secondaryId={}, QString query={}) Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Uri.html Construct a Matrix URI from components. ```APIDOC ## Uri(QByteArray primaryId, QByteArray secondaryId={}, QString query={}) ### Description Construct a Matrix URI from components. ### Method Constructor ### Signature Uri(QByteArray primaryId, QByteArray secondaryId={}, QString query={}) ### Parameters - **primaryId** (QByteArray) - Required - The primary identifier component. - **secondaryId** (QByteArray) - Optional - The secondary identifier component. Defaults to empty. - **query** (QString) - Optional - The query component. Defaults to empty. ### Returns A new Uri object constructed from the given components. ``` -------------------------------- ### name() const Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1User.html Gets the default user name. ```APIDOC ## name() const ### Description Gets the default user name. ### Method QString name() const ### Returns - **QString** - The default user name. ``` -------------------------------- ### capabilitiesReady Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Connection.html Find out if homeserver capabilities have been loaded. ```APIDOC ## capabilitiesReady ### Description Find out if homeserver capabilities have been loaded. ### Method Q_INVOKABLE bool capabilitiesReady() const ### Returns bool - True if capabilities are ready, false otherwise. ``` -------------------------------- ### SearchJob::errorString() Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1SearchJob.html Gets the error-specific message from the server. ```APIDOC ## SearchJob::errorString() ### Description Returns the error-specific message returned by the server, if any. ### Parameters None ### Returns - **QString** - Error message. ``` -------------------------------- ### importFromBackup Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Connection.html Import keys from backup. ```APIDOC ## importFromBackup ### Description Import keys from backup. ### Method Q_INVOKABLE void importFromBackup()" ``` -------------------------------- ### instance Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1NetworkAccessManager.html Gets a NetworkAccessManager instance for the current thread. ```APIDOC ## instance ### Description Gets a NetworkAccessManager instance for the current thread. ### Method static ### Signature static NetworkAccessManager * Quotient::NetworkAccessManager::instance() ### Returns - **NetworkAccessManager*** - A pointer to the instance for the current thread. ``` -------------------------------- ### homeserver() Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Connection.html Returns the base URL of the homeserver to connect to. ```APIDOC ## homeserver() ### Description Get the base URL of the homeserver to connect to. ### Signature `QUrl homeserver() const` ### Returns - `QUrl` - The homeserver base URL. ``` -------------------------------- ### getDirectChat Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Connection.html Get a future to a direct chat with the user. ```APIDOC ## getDirectChat ### Description Get a future to a direct chat with the user. ### Method Q_INVOKABLE QFuture getDirectChat(const QString &otherUserId) ### Parameters - otherUserId (QString) - The ID of the other user. ### Returns QFuture - A future that resolves to the direct chat room. ``` -------------------------------- ### ready() Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Connection-members.html Signal emitted when the connection is ready. This is a signal that can be connected to. ```APIDOC ## ready() ### Description Signal emitted when the connection is ready. ### Method signal ### Parameters None. ``` -------------------------------- ### Migration example: replace connect() with onResult() Source: https://quotient-im.github.io/libQuotient/jobhandle_8h_source.html Shows the old pattern of connecting to BaseJob::result and the replacement using onResult(). The old code uses callApi() and connect(), while the new code chains onResult() directly. ```cpp auto j = callApi(jobParams...); connect(j, &BaseJob::result, object, slot); ``` ```cpp callApi(jobParams...).onResult(object, slot); ``` -------------------------------- ### defaultRoomVersion Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Connection.html Get the room version recommended by the server. ```APIDOC ## defaultRoomVersion ### Description Get the room version recommended by the server. ### Method QString defaultRoomVersion() const ### Returns QString - The default room version. ``` -------------------------------- ### requestDirectChat Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Connection.html Get a direct chat with a single user. ```APIDOC ## requestDirectChat ### Description Get a direct chat with a single user. ### Method void requestDirectChat(const QString &userId) ### Parameters - **userId** (QString) - Required - The user ID. ``` -------------------------------- ### ImageInfo::ImageInfo(const QFileInfo&, QSize) Source: https://quotient-im.github.io/libQuotient/structQuotient_1_1EventContent_1_1Thumbnail.html Constructs an ImageInfo from a file info and optional image size. ```APIDOC ## ImageInfo::ImageInfo(const QFileInfo&, QSize) ### Description Constructs an ImageInfo from a file info and optional image size. ### Method Constructor ### Signature `explicit Quotient::EventContent::ImageInfo::ImageInfo(const QFileInfo &_fi_, QSize _imageSize_ = {})` ### Parameters - **const QFileInfo &_fi_** - The file information. - **QSize _imageSize_** - Optional image size (default is empty). ### Return Value None (constructor). ``` -------------------------------- ### versions() Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1GetVersionsJob.html Returns the list of supported specification versions as a QStringList. ```APIDOC ## versions() ### Description Returns the supported versions of the specification. ### Method QStringList versions() const ### Returns QStringList - The list of supported versions. ``` -------------------------------- ### getThumbnail (mediaId) Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Connection.html Get a thumbnail for a media ID. ```APIDOC ## getThumbnail (mediaId) ### Description Get a thumbnail for a media ID. ### Method virtual JobHandle getThumbnail(const QString &mediaId, QSize requestedSize, RunningPolicy policy=BackgroundRequest) ### Parameters - **mediaId** (QString) - Required - The media ID. - **requestedSize** (QSize) - Required - The requested thumbnail size. - **policy** (RunningPolicy) - Optional - The running policy, defaults to BackgroundRequest. ### Returns JobHandle - A job handle for the thumbnail request. ``` -------------------------------- ### Quotient::GetConfigAuthedJob Source: https://quotient-im.github.io/libQuotient/authed-content-repo_8h.html Get the configuration for the content repository. ```APIDOC ## Quotient::GetConfigAuthedJob ### Description Get the configuration for the content repository. ### Method GET ### Endpoint /_matrix/client/v1/media/config ### Response #### Success Response (200) - **uploadSize** (integer) - The maximum upload size in bytes. #### Response Example { "uploadSize": 10485760 } ``` -------------------------------- ### loginWithToken(const QString &loginToken, const QString &initialDeviceName, const QString &deviceId={}) Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Connection-members.html Logs in using a login token. This is a slot that can be called directly. ```APIDOC ## loginWithToken(const QString &loginToken, const QString &initialDeviceName, const QString &deviceId={}) ### Description Logs in using a login token. ### Method slot ### Parameters - **loginToken** (QString) - Required - The login token. - **initialDeviceName** (QString) - Required - The initial device name. - **deviceId** (QString) - Optional - The device ID, defaults to empty. ``` -------------------------------- ### Quotient::GetUrlPreviewAuthedJob Source: https://quotient-im.github.io/libQuotient/authed-content-repo_8h.html Get information about a URL for a client. ```APIDOC ## Quotient::GetUrlPreviewAuthedJob ### Description Get information about a URL for a client. ### Method GET ### Endpoint /_matrix/client/v1/media/preview_url ### Parameters #### Query Parameters - **url** (string) - Required - The URL to preview. - **ts** (integer) - Optional - The timestamp to consider for the preview. ### Response #### Success Response (200) - **og:title** (string) - The title of the URL. - **og:description** (string) - The description of the URL. - **og:image** (string) - The image URL. #### Response Example { "og:title": "Example Title", "og:description": "Example description", "og:image": "https://example.com/image.png" } ``` -------------------------------- ### PutRoomKeysVersionJob Constructor Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1PutRoomKeysVersionJob.html Constructs a PutRoomKeysVersionJob with the specified version, algorithm, and authentication data to update an existing backup. ```APIDOC ## PutRoomKeysVersionJob Constructor ### Description Constructs a job to update information about an existing backup. ### Constructor `PutRoomKeysVersionJob(const QString &version, const QString &algorithm, const QJsonObject &authData)` ### Parameters - **version** (QString) - Required - The backup version to update. - **algorithm** (QString) - Required - The algorithm used for the backup. - **authData** (QJsonObject) - Required - Authentication data for the backup. ### Usage This constructor creates a job that can be executed to update the backup information. ``` -------------------------------- ### newFileTransfer Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Room.html Emitted when a new file transfer starts. ```APIDOC ## Signal: newFileTransfer ### Description Emitted when a new file transfer starts. ### Parameters - id (QString) - The ID of the file transfer. - localFile (QUrl) - The local file URL. ### Emitted by Quotient::Room ``` -------------------------------- ### GetRoomKeysVersionJob(const QString &version) Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1GetRoomKeysVersionJob.html Constructs a job to get information about an existing backup version. The version parameter specifies the backup version to retrieve. ```APIDOC ## GetRoomKeysVersionJob(const QString &version) ### Description Constructs a job to get information about an existing backup version. ### Constructor GetRoomKeysVersionJob(const QString &version) ### Parameters - **version** (const QString &) - Required - The backup version to get, as returned in the `version` parameter of the response in `POST /_matrix/client/v3/room_keys/version` or this endpoint. ``` -------------------------------- ### Room::Room(Connection*, QString, JoinState) Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Room.html Constructs a Room object with the given connection, room ID, and initial join state. ```APIDOC ## Room::Room(Connection*, QString, JoinState) ### Description Constructs a Room object with the specified connection, room ID, and initial join state. ### Signature Quotient::Room::Room(Connection* _connection_, QString _id_, JoinState _initialJoinState_) ### Parameters - **connection** (Connection*) - Required - The connection object. - **id** (QString) - Required - The room ID. - **initialJoinState** (JoinState) - Required - The initial join state of the room. ``` -------------------------------- ### AccountSettings::homeserver Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1AccountSettings.html Returns the homeserver URL for this account. ```APIDOC ## AccountSettings::homeserver ### Description Returns the homeserver URL for this account. ### Signature QUrl homeserver() const ### Returns QUrl - The homeserver URL. ``` -------------------------------- ### joinedMembers Source: https://quotient-im.github.io/libQuotient/classQuotient_1_1Room.html Get a list of room members who have joined the room. ```APIDOC ## joinedMembers() ### Description Get a list of room members who have joined the room. ### Method joinedMembers ### Signature QList Quotient::Room::joinedMembers() const ### Returns - **QList** - List of joined room members. ```