QXmpp Version: 1.10.0
|
The QXmppPresence class represents an XMPP presence stanza. More...
#include <QXmppPresence.h>
Public Types | |
enum | Type { Error = 0 , Available , Unavailable , Subscribe , Subscribed , Unsubscribe , Unsubscribed , Probe } |
This enum is used to describe a presence type. More... | |
enum | AvailableStatusType { Online = 0 , Away , XA , DND , Chat , Invisible } |
This enum is used to describe an availability status. More... | |
enum | VCardUpdateType { VCardUpdateNone = 0 , VCardUpdateNoPhoto , VCardUpdateValidPhoto , VCardUpdateNotReady } |
Public Member Functions | |
QXmppPresence (QXmppPresence::Type type=QXmppPresence::Available) | |
QXmppPresence (const QXmppPresence &other) | |
Copy-constructor. | |
QXmppPresence (QXmppPresence &&) | |
Move-constructor. | |
~QXmppPresence () override | |
Destroys a QXmppPresence. | |
QXmppPresence & | operator= (const QXmppPresence &other) |
Assignemnt operator. | |
QXmppPresence & | operator= (QXmppPresence &&) |
Move-assignemnt operator. | |
bool | isXmppStanza () const override |
AvailableStatusType | availableStatusType () const |
void | setAvailableStatusType (AvailableStatusType type) |
Sets the availability status type, for instance busy or away. | |
int | priority () const |
Returns the priority level of the resource. | |
void | setPriority (int priority) |
Sets the priority level of the resource. | |
QXmppPresence::Type | type () const |
void | setType (QXmppPresence::Type) |
Sets the presence type. | |
QString | statusText () const |
Returns the status text, a textual description of the user's status. | |
void | setStatusText (const QString &statusText) |
QXmppMucItem | mucItem () const |
Returns the MUC item. | |
void | setMucItem (const QXmppMucItem &item) |
Sets the MUC item. | |
QString | mucPassword () const |
Returns the password used to join a MUC room. | |
void | setMucPassword (const QString &password) |
Sets the password used to join a MUC room. | |
QList< int > | mucStatusCodes () const |
Returns the MUC status codes. | |
void | setMucStatusCodes (const QList< int > &codes) |
Sets the MUC status codes. | |
bool | isMucSupported () const |
Returns true if the sender has indicated MUC support. | |
void | setMucSupported (bool supported) |
Sets whether MUC is supported. | |
QByteArray | photoHash () const |
Returns the photo-hash of the VCardUpdate. | |
void | setPhotoHash (const QByteArray &) |
VCardUpdateType | vCardUpdateType () const |
Returns the type of VCardUpdate. | |
void | setVCardUpdateType (VCardUpdateType type) |
Sets the type of VCardUpdate. | |
QString | capabilityHash () const |
XEP-0115: Entity Capabilities | |
void | setCapabilityHash (const QString &) |
XEP-0115: Entity Capabilities | |
QString | capabilityNode () const |
XEP-0115: Entity Capabilities | |
void | setCapabilityNode (const QString &) |
XEP-0115: Entity Capabilities | |
QByteArray | capabilityVer () const |
XEP-0115: Entity Capabilities | |
void | setCapabilityVer (const QByteArray &) |
XEP-0115: Entity Capabilities | |
QStringList | capabilityExt () const |
Legacy XEP-0115: Entity Capabilities. | |
bool | isPreparingMujiSession () const |
void | setIsPreparingMujiSession (bool isPreparingMujiSession) |
QVector< QXmppJingleIq::Content > | mujiContents () const |
void | setMujiContents (const QVector< QXmppJingleIq::Content > &mujiContents) |
QString | oldJid () const |
void | setOldJid (const QString &oldJid) |
QDateTime | lastUserInteraction () const |
void | setLastUserInteraction (const QDateTime &) |
QString | mixUserJid () const |
void | setMixUserJid (const QString &) |
QString | mixUserNick () const |
void | setMixUserNick (const QString &) |
Public Member Functions inherited from QXmppStanza | |
QXmppStanza (const QString &from=QString(), const QString &to=QString()) | |
QXmppStanza (const QXmppStanza &other) | |
Constructs a copy of other. | |
QXmppStanza (QXmppStanza &&) | |
Move constructor. | |
~QXmppStanza () override | |
Destroys a QXmppStanza. | |
QXmppStanza & | operator= (const QXmppStanza &other) |
Assigns other to this stanza. | |
QXmppStanza & | operator= (QXmppStanza &&) |
Move-assignment operator. | |
QString | to () const |
void | setTo (const QString &) |
QString | from () const |
void | setFrom (const QString &) |
QString | id () const |
void | setId (const QString &) |
QString | lang () const |
void | setLang (const QString &) |
QXmppStanza::Error | error () const |
std::optional< Error > | errorOptional () const |
void | setError (const QXmppStanza::Error &error) |
void | setError (const std::optional< Error > &error) |
QXmppElementList | extensions () const |
void | setExtensions (const QXmppElementList &elements) |
QList< QXmppExtendedAddress > | extendedAddresses () const |
void | setExtendedAddresses (const QList< QXmppExtendedAddress > &extendedAddresses) |
std::optional< QXmppE2eeMetadata > | e2eeMetadata () const |
void | setE2eeMetadata (const std::optional< QXmppE2eeMetadata > &e2eeMetadata) |
Public Member Functions inherited from QXmppNonza | |
virtual bool | isXmppStanza () const |
virtual void | parse (const QDomElement &)=0 |
virtual void | toXml (QXmlStreamWriter *writer) const =0 |
The QXmppPresence class represents an XMPP presence stanza.
This enum is used to describe an availability status.
Enumerator | |
---|---|
Online | The entity or resource is online. |
Away | The entity or resource is temporarily away. |
XA | The entity or resource is away for an extended period. |
DND | The entity or resource is busy ("Do Not Disturb"). |
Chat | The entity or resource is actively interested in chatting. |
Invisible | obsolete XEP-0018: Invisible Presence |
enum QXmppPresence::Type |
This enum is used to describe a presence type.
This enum is used to describe vCard updates as defined by XEP-0153: vCard-Based Avatars
QXmppPresence::QXmppPresence | ( | QXmppPresence::Type | type = QXmppPresence::Available | ) |
Constructs a QXmppPresence.
QXmppPresence::AvailableStatusType QXmppPresence::availableStatusType | ( | ) | const |
Returns the availability status type, for instance busy or away.
This will not tell you whether a contact is connected, check whether type() is QXmppPresence::Available instead.
bool QXmppPresence::isPreparingMujiSession | ( | ) | const |
Returns whether a XEP-0272: Multiparty Jingle (Muji) session is being prepared.
|
overridevirtual |
Indicates if the QXmppStanza is a stanza in the XMPP sence (i. e. a message, iq or presence)
Reimplemented from QXmppNonza.
QDateTime QXmppPresence::lastUserInteraction | ( | ) | const |
QString QXmppPresence::mixUserJid | ( | ) | const |
Returns the actual (full) JID of the MIX channel participant.
QString QXmppPresence::mixUserNick | ( | ) | const |
Returns the MIX participant's nickname.
QVector< QXmppJingleIq::Content > QXmppPresence::mujiContents | ( | ) | const |
QString QXmppPresence::oldJid | ( | ) | const |
Returns the XEP-0283: Moved user's old jid.
void QXmppPresence::setIsPreparingMujiSession | ( | bool | isPreparingMujiSession | ) |
Sets whether a XEP-0272: Multiparty Jingle (Muji) session is being prepared.
isPreparingMujiSession | whether a Muji session is being prepared |
void QXmppPresence::setLastUserInteraction | ( | const QDateTime & | lastUserInteraction | ) |
void QXmppPresence::setMixUserJid | ( | const QString & | mixUserJid | ) |
Sets the actual (full) JID of the MIX channel participant.
void QXmppPresence::setMixUserNick | ( | const QString & | mixUserNick | ) |
Sets the MIX participant's nickname.
void QXmppPresence::setMujiContents | ( | const QVector< QXmppJingleIq::Content > & | mujiContents | ) |
Sets XEP-0272: Multiparty Jingle (Muji) contents.
mujiContents | Muji contents |
void QXmppPresence::setOldJid | ( | const QString & | oldJid | ) |
Sets the XEP-0283: Moved user's old jid.
void QXmppPresence::setPhotoHash | ( | const QByteArray & | photoHash | ) |
Sets the photo-hash of the VCardUpdate.
photoHash | as QByteArray |
void QXmppPresence::setStatusText | ( | const QString & | statusText | ) |
Sets the status text, a textual description of the user's status.
statusText | The status text, for example "Gone fishing". |
QXmppPresence::Type QXmppPresence::type | ( | ) | const |
Returns the presence type.
You can use this method to determine the action which needs to be taken in response to receiving the presence. For instance, if the type is QXmppPresence::Available or QXmppPresence::Unavailable, you could update the icon representing a contact's availability.