QXmpp Version: 1.5.6
|
The QXmppAttentionManager class manages attention requests as defined by XEP-0224: Attention. More...
Public Slots | |
QString | requestAttention (const QString &jid, const QString &message={}) |
Signals | |
void | attentionRequested (const QXmppMessage &message, bool isTrusted) |
void | attentionRequestRateLimited (const QXmppMessage &message) |
Signals inherited from QXmppLoggable | |
void | setGauge (const QString &gauge, double value) |
Sets the given gauge to value. | |
void | logMessage (QXmppLogger::MessageType type, const QString &msg) |
This signal is emitted to send logging messages. | |
void | updateCounter (const QString &counter, qint64 amount=1) |
Updates the given counter by amount. | |
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) |
Public Member Functions inherited from QXmppClientExtension | |
QXmppClientExtension () | |
virtual QList< QXmppDiscoveryIq::Identity > | 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) | |
Protected Member Functions | |
void | setClient (QXmppClient *client) override |
Protected Member Functions inherited from QXmppClientExtension | |
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) |
void | info (const QString &message) |
void | warning (const QString &message) |
void | logReceived (const QString &message) |
void | logSent (const QString &message) |
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.
|
signal |
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. |
|
signal |
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.
|
slot |
Sends a message of type chat with an attention request to the specified JID.
XEP-0224 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.
|
overrideprotectedvirtual |
Sets the client which loaded this extension.
client |
Reimplemented from QXmppClientExtension.