QXmppCarbonManagerV2 Class

The QXmppCarbonManagerV2 class handles message carbons as described in XEP-0280: Message Carbons. More...

Header: #include <QXmppCarbonManagerV2.h>
Since: QXmpp 1.5
Inherits: QXmppClientExtension

Public Functions

QBindable<bool> enabled() const
(since QXmpp 1.17) QXmppDiscoFeatureWatch watchServerSupport() const

Detailed Description

The manager automatically enables carbons when a connection is established. Either by using XEP-0386: Bind 2 if available or by sending a normal IQ request on connection, if the server supports carbons. The server support is checked using the QXmppDiscoveryManager. If it is not registered with the client, carbons are enabled without checking the support. Carbon copied messages from other devices of the same account and carbon copied messages from other accounts are injected into the QXmppClient. This way you can handle them like any other incoming message by implementing QXmppMessageHandler or using QXmppClient::messageReceived().

Checks are done to ensure that the entity sending the carbon copy is allowed to send the forwarded message.

You don't need to do anything other than adding the extension to the client to use it.

QXmppClient client;
client.addNewExtension<QXmppCarbonManagerV2>();

To distinguish carbon messages, you can use QXmppMessage::isCarbonMessage().

Note: Enabling via Bind 2 has been added in QXmpp 1.8.

Member Function Documentation

QBindable<bool> QXmppCarbonManagerV2::enabled() const

Returns whether message carbons are currently enabled on the server.

[since QXmpp 1.17] QXmppDiscoFeatureWatch QXmppCarbonManagerV2::watchServerSupport() const

Returns a watch on whether the own server supports XEP-0280: Message Carbons.

The information is requested as long as a copy of the watch exists and shared with all other watches on the server information. This requires the QXmppDiscoveryManager to be registered with the client. If the manager is not registered with a client, a watch that never loads is returned.

This function was introduced in QXmpp 1.17.