QXmpp: QXmppMucManagerV2 Class Reference

QXmpp Version: 1.14.3

Loading...
Searching...
No Matches
QXmppMucManagerV2 Class Reference
Managers

XEP-0045: Multi-User Chat Manager with support for XEP-0402: PEP Native Bookmarks. More...

Inheritance diagram for QXmppMucManagerV2:

## Public Member Functions
| QXmppMucManagerV2 ()
| Default constructor.
QStringList | discoveryFeatures () const override
| Supported service discovery features.
const std::optional< QList< QXmppMucBookmark > > & | bookmarks () const
| Retrieved bookmarks.
Q_SIGNAL void | bookmarksReset ()
Q_SIGNAL void | bookmarksAdded (const QList< QXmppMucBookmark > &newBookmarks)
Q_SIGNAL void | bookmarksChanged (const QList< QXmppMucManagerV2::BookmarkChange > &bookmarkUpdates)
Q_SIGNAL void | bookmarksRemoved (const QList< QString > &removedBookmarkJids)
QXmppTask< QXmpp::Result<> > | setBookmark (QXmppMucBookmark &&bookmark)
| Adds or updates the bookmark for a MUC.
QXmppTask< QXmpp::Result<> > | removeBookmark (const QString &jid)
| Removes a bookmark.
QXmppTask< QXmpp::Result<> > | setRoomAvatar (const QString &jid, const Avatar &avatar)
QXmppTask< QXmpp::Result<> > | removeRoomAvatar (const QString &jid)
QXmppTask< QXmpp::Result< std::optional< Avatar > > > | fetchRoomAvatar (const QString &jid)
bool | handlePubSubEvent (const QDomElement &element, const QString &pubSubService, const QString &nodeName) override
| Handles incoming PubSub events.
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.

## Friends
class | QXmppMucManagerV2Private
class | tst_QXmppMuc

## Detailed Description

XEP-0045: Multi-User Chat Manager with support for XEP-0402: PEP Native Bookmarks.

The manager automatically fetches bookmarks on session establishment and afterwards emits bookmarksReset(), bookmarksAdded(), bookmarksRemoved() and bookmarksChanged().

The QXmppPubSubManager must be registered with the client.

Note
  This manager is work-in-progress and joining MUCs is not yet implemented.

Since
  QXmpp 1.13

## Member Function Documentation

## ◆ bookmarksAdded()

Q_SIGNAL void QXmppMucManagerV2::bookmarksAdded | ( | const QList< QXmppMucBookmark > & | newBookmarks | ) |

Emitted when bookmarks have been added. This is triggered by PubSub event notifications.

## ◆ bookmarksChanged()

Q_SIGNAL void QXmppMucManagerV2::bookmarksChanged | ( | const QList< QXmppMucManagerV2::BookmarkChange > & | bookmarkUpdates | ) |

Emitted when bookmarks have been changed.

## ◆ bookmarksRemoved()

Q_SIGNAL void QXmppMucManagerV2::bookmarksRemoved | ( | const QList< QString > & | removedBookmarkJids | ) |

Emitted when bookmarks are retracted.

## ◆ bookmarksReset()

Q_SIGNAL void QXmppMucManagerV2::bookmarksReset | ( |  | ) |

Emitted when the total set of bookmarks is reset, e.g. when receiving the initial bookmarks items query.

## ◆ discoveryFeatures()

QStringList QXmppMucManagerV2::discoveryFeatures | ( |  | ) | const
| overridevirtual

Supported service discovery features.

Reimplemented from QXmppClientExtension.

## ◆ fetchRoomAvatar()

QXmppTask< Result< std::optional< QXmppMucManagerV2::Avatar > > > QXmppMucManagerV2::fetchRoomAvatar | ( | const QString & | jid | ) |

Fetches the Avatar of a MUC room

First fetches the avatar hashes via the muc#roominfo form from service discovery information and then fetches the avatar itself via vcard-temp.

Note
  This currently does not do any caching and does not listen for avatar changes.

Parameters

  jid | JID of the MUC room

Returns
  nullopt if VCards are not supported in this MUC or no avatar has been published, otherwise the published avatar

## ◆ handlePubSubEvent()

bool QXmppMucManagerV2::handlePubSubEvent | ( | const QDomElement & | element,
|  | const QString & | pubSubService,
|  | const QString & | nodeName )
| overridevirtual

Handles incoming PubSub events.

Implements QXmppPubSubEventHandler.

## ◆ onRegistered()

void QXmppMucManagerV2::onRegistered | ( | QXmppClient * | client | ) |
| overrideprotectedvirtual

Called after the extension has been added to a QXmppClient.

Parameters

  client |

Reimplemented from QXmppClientExtension.

## ◆ onUnregistered()

void QXmppMucManagerV2::onUnregistered | ( | QXmppClient * | client | ) |
| overrideprotectedvirtual

Called after the extension has been removed from a QXmppClient.

Parameters

  client |

Reimplemented from QXmppClientExtension.

## ◆ removeRoomAvatar()

QXmppTask< QXmpp::Result<> > QXmppMucManagerV2::removeRoomAvatar | ( | const QString & | jid | ) |

Removes the avatar of a MUC room.

Requires the MUC service to support "vcard-temp" and to be "an owner or some other priviledged entity" of the MUC.

Parameters

  jid | JID of the MUC room

## ◆ setRoomAvatar()

QXmppTask< QXmpp::Result<> > QXmppMucManagerV2::setRoomAvatar | ( | const QString & | jid,
|  | const Avatar & | avatar )

Sets the avatar of a MUC room.

Requires the MUC service to support "vcard-temp" and to be "an owner or some other priviledged entity" of the MUC.

Parameters

  jid | JID of the MUC room
  avatar | Avatar to be set

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

- QXmppMucManagerV2.h
- QXmppMucManagerV2.cpp