|
QXmpp Version: 1.15.1
|
The QXmppAttentionManager class manages attention requests as defined by XEP-0224: Attention. More...


Public Member Functions | |
| QXmppAttentionManager (quint8 allowedAttempts=3, QTime timeFrame=QTime(0, 15, 0)) | |
| QXmppAttentionManager::QXmppAttentionManager. | |
| QStringList | discoveryFeatures () const override |
| quint8 | allowedAttempts () const |
| void | setAllowedAttempts (quint8 allowedAttempts) |
| QTime | allowedAttemptsTimeInterval () const |
| void | setAllowedAttemptsTimeInterval (QTime interval) |
| Q_SLOT QString | requestAttention (const QString &jid, const QString &message={}) |
| Q_SIGNAL void | attentionRequested (const QXmppMessage &message, bool isTrusted) |
| Q_SIGNAL void | attentionRequestRateLimited (const QXmppMessage &message) |
Public Member Functions inherited from QXmppClientExtension | |
| QXmppClientExtension () | |
| virtual QList< QXmppDiscoIdentity > | discoveryIdentities () const |
| virtual bool | handleStanza (const QDomElement &stanza) |
| You need to implement this method to process incoming XMPP stanzas. | |
| virtual bool | handleStanza (const QDomElement &stanza, const std::optional< QXmppE2eeMetadata > &e2eeMetadata) |
| 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 | |
| QXmppClient * | client () 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. | |
The QXmppAttentionManager class manages attention requests as defined by XEP-0224: Attention.
The manager also does some checks, including rate limiting and checking whether the senders are trusted (aka. in the roster).
Rate limited messages are not emitted on the normal attentionRequested() signal and are sent on the attentionRequestRateLimited() signal instead.
To use this manager you still need to instantiate it and register it with the QXmppClient:
| QXmppAttentionManager::QXmppAttentionManager | ( | quint8 | allowedAttempts = 3, |
| QTime | timeFrame = QTime(0, 15, 0) |
||
| ) |
QXmppAttentionManager::QXmppAttentionManager.
| allowedAttempts | |
| timeFrame |
| quint8 QXmppAttentionManager::allowedAttempts | ( | ) | const |
Returns the number of allowed attempts of attentions from a bare JID in the set time frame.
| QTime QXmppAttentionManager::allowedAttemptsTimeInterval | ( | ) | const |
Returns the time interval for the allowed attempts for rate limiting.
| QXmppAttentionManager::attentionRequested | ( | const QXmppMessage & | message, |
| bool | isTrusted | ||
| ) |
This signal is emitted when an attention request was received and it passed the rate limiter.
| message | The message with the attention request that was received. |
| isTrusted | Whether the sender of the message exists in the user's roster. |
| QXmppAttentionManager::attentionRequestRateLimited | ( | const QXmppMessage & | message | ) |
This signal is emitted when an attention request did not pass the rate limiter.
| message | The message with the attention request that did not pass the rate limiter. |
|
overridevirtual |
Returns the XEP-0224: Attention feature.
Reimplemented from QXmppClientExtension.
|
overrideprotectedvirtual |
Called after the extension has been added to a QXmppClient.
| client |
Reimplemented from QXmppClientExtension.
|
overrideprotectedvirtual |
Called after the extension has been removed from a QXmppClient.
| client |
Reimplemented from QXmppClientExtension.
| QString QXmppAttentionManager::requestAttention | ( | const QString & | jid, |
| const QString & | message = {} |
||
| ) |
Sends a message of type chat with an attention request to the specified JID.
XEP-0224: Attention allows to include other elements with an attention request, but the QXmppAttentionManager has no method for this purpose. However, such a request can still be made manually.
| jid | The address to which the request should be sent. |
| message | The message body to include in the attention request. |
| void QXmppAttentionManager::setAllowedAttempts | ( | quint8 | allowedAttempts | ) |
Sets the number of allowed attempts of attentions from a bare JID in the set time frame.
| void QXmppAttentionManager::setAllowedAttemptsTimeInterval | ( | QTime | interval | ) |
Returns the time interval for the allowed attempts for rate limiting.