@@ -121,17 +121,30 @@ static void serializeMixData(const MixData &d, QXmlStreamWriter &writer)
121
121
// / connection:
122
122
// / * participantSupport()
123
123
// / * messageArchivingSupport()
124
- // / That is done via QXmppDiscoveryManager::requestInfo():
124
+ // / That is done via QXmppDiscoveryManager::requestInfo() for the user JID (i.e., no recipient JID) :
125
125
// / \code
126
- // / client->findExtension<QXmppDiscoveryManager>()->requestInfo(client->configuration().domain() );
126
+ // / client->findExtension<QXmppDiscoveryManager>()->requestInfo({} );
127
127
// / \endcode
128
128
// /
129
129
// / Before calling one of the following methods, you need to request the information once per
130
130
// / connection:
131
131
// / * services()
132
- // / That is done via QXmppDiscoveryManager::requestItems():
132
+ // / That is done via QXmppDiscoveryManager::requestDiscoItems() for the server JID and
133
+ // / QXmppDiscoveryManager::requestInfo() for each item it provides:
133
134
// / \code
134
- // / client->findExtension<QXmppDiscoveryManager>()->requestItems(client->configuration().domain());
135
+ // / const auto *discoveryManager = client->findExtension<QXmppDiscoveryManager>();
136
+ // / discoveryManager->requestDiscoItems(client->configuration().domain())
137
+ // / .then(this, [this](QXmppDiscoveryManager::ItemsResult &&result) {
138
+ // / if (const auto *error = std::get_if<QXmppError>(&result)) {
139
+ // / // Handle the error.
140
+ // / } else {
141
+ // / const auto items = std::get<QList<QXmppDiscoveryIq::Item>>(std::move(result));
142
+ // / for (const auto &item : items) {
143
+ // / discoveryManager->requestInfo(item.jid());
144
+ // / }
145
+ // / }
146
+ // / }
147
+ // / );
135
148
// / \endcode
136
149
// /
137
150
// / If you want to be informed about updates of the channel (e.g., its configuration or allowed
@@ -1394,7 +1407,7 @@ QXmppTask<QXmppClient::EmptyResult> QXmppMixManager::addJidToNode(const QString
1394
1407
void QXmppMixManager::handleDiscoInfo (const QXmppDiscoveryIq &iq)
1395
1408
{
1396
1409
// Check the server's functionality to support MIX clients.
1397
- if (iq.from ().isEmpty () || iq.from () == client ()->configuration ().domain ()) {
1410
+ if (iq.from ().isEmpty () || iq.from () == client ()->configuration ().jidBare ()) {
1398
1411
// Check whether MIX is supported.
1399
1412
if (iq.features ().contains (ns_mix_pam)) {
1400
1413
setParticipantSupport (QXmppMixManager::Support::Supported);
@@ -1409,7 +1422,7 @@ void QXmppMixManager::handleDiscoInfo(const QXmppDiscoveryIq &iq)
1409
1422
}
1410
1423
}
1411
1424
1412
- const auto jid = iq.from (). isEmpty () ? client ()-> configuration (). domain () : iq. from () ;
1425
+ const auto jid = iq.from ();
1413
1426
1414
1427
// If no MIX service is provided by the JID, remove it from the cache.
1415
1428
if (!iq.features ().contains (ns_mix)) {
@@ -1424,7 +1437,7 @@ void QXmppMixManager::handleDiscoInfo(const QXmppDiscoveryIq &iq)
1424
1437
// ' || identity.type() == u"text"' is a workaround for older ejabberd versions.
1425
1438
if (identity.category () == u" conference" && (identity.type () == MIX_SERVICE_DISCOVERY_NODE || identity.type () == u" text" )) {
1426
1439
Service service;
1427
- service.jid = iq. from (). isEmpty () ? client ()-> configuration (). domain () : iq. from () ;
1440
+ service.jid = jid ;
1428
1441
service.channelsSearchable = iq.features ().contains (ns_mix_searchable);
1429
1442
service.channelCreationAllowed = iq.features ().contains (ns_mix_create_channel);
1430
1443
0 commit comments