QXmpp Version: 1.15.1
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
QXmppCarbonManagerV2 Class Reference

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

Inheritance diagram for QXmppCarbonManagerV2:
Inheritance graph
[legend]
Collaboration diagram for QXmppCarbonManagerV2:
Collaboration graph
[legend]

Public Member Functions

QBindable< bool > enabled () const
 
bool handleStanza (const QDomElement &, const std::optional< QXmppE2eeMetadata > &) override
 You need to implement this method to process incoming XMPP stanzas.
 
- Public Member Functions inherited from QXmppClientExtension
 QXmppClientExtension ()
 
virtual QStringList discoveryFeatures () const
 
virtual QList< QXmppDiscoIdentitydiscoveryIdentities () const
 
virtual bool handleStanza (const QDomElement &stanza)
 You need to implement this method to process incoming XMPP stanzas.
 
- Public Member Functions inherited from QXmppLoggable
 QXmppLoggable (QObject *parent=nullptr)
 
Q_SIGNAL void setGauge (const QString &gauge, double value)
 Sets the given gauge to value.
 
Q_SIGNAL void logMessage (QXmppLogger::MessageType type, const QString &msg)
 This signal is emitted to send logging messages.
 
Q_SIGNAL void updateCounter (const QString &counter, qint64 amount=1)
 Updates the given counter by amount.
 

Protected Member Functions

void onRegistered (QXmppClient *client) override
 
void onUnregistered (QXmppClient *client) override
 
- Protected Member Functions inherited from QXmppClientExtension
QXmppClientclient () const
 
virtual void setClient (QXmppClient *client)
 
void injectIq (const QDomElement &element, const std::optional< QXmppE2eeMetadata > &e2eeMetadata)
 
bool injectMessage (QXmppMessage &&message)
 
- Protected Member Functions inherited from QXmppLoggable
void debug (const QString &message)
 Logs a debugging message.
 
void info (const QString &message)
 Logs an informational message.
 
void warning (const QString &message)
 Logs a warning message.
 
void logReceived (const QString &message)
 Logs a received packet.
 
void logSent (const QString &message)
 Logs a sent packet.
 

Detailed Description

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

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. 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.

The QXmppCarbonManagerV2 class handles message carbons as described in XEP-0280: Message Carbons.
Definition QXmppCarbonManagerV2.h:13
QXmppClient * client() const
Definition QXmppClientExtension.cpp:57
Main class for starting and managing connections to XMPP servers.
Definition QXmppClient.h:62
T * addNewExtension(Args... args)
Definition QXmppClient.h:117

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

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

Member Function Documentation

◆ enabled()

QBindable< bool > QXmppCarbonManagerV2::enabled ( ) const

Returns whether message carbons are currently enabled on the server.

◆ handleStanza()

bool QXmppCarbonManagerV2::handleStanza ( const QDomElement &  stanza,
const std::optional< QXmppE2eeMetadata > &  e2eeMetadata 
)
overridevirtual

You need to implement this method to process incoming XMPP stanzas.

Parameters
stanzaThe DOM element to be handled.
e2eeMetadataIf the element has been decrypted this contains metadata about the encryption.
Returns
You should return true if the stanza was handled and no further processing should occur, or false to let other extensions process the stanza.
Since
QXmpp 1.5

Reimplemented from QXmppClientExtension.

◆ onRegistered()

void QXmppCarbonManagerV2::onRegistered ( QXmppClient client)
overrideprotectedvirtual

Called after the extension has been added to a QXmppClient.

Parameters
client

Reimplemented from QXmppClientExtension.

◆ onUnregistered()

void QXmppCarbonManagerV2::onUnregistered ( QXmppClient client)
overrideprotectedvirtual

Called after the extension has been removed from a QXmppClient.

Parameters
client

Reimplemented from QXmppClientExtension.


The documentation for this class was generated from the following files: