Skip to content

Commit

Permalink
MixManager: Fix assert and disconnect from right signal
Browse files Browse the repository at this point in the history
  • Loading branch information
melvo committed Apr 22, 2024
1 parent 80d10a8 commit acd49df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/client/QXmppMixManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -946,14 +946,14 @@ void QXmppMixManager::onRegistered(QXmppClient *client)
connect(d->discoveryManager, &QXmppDiscoveryManager::infoReceived, this, &QXmppMixManager::handleDiscoInfo);

d->pubSubManager = client->findExtension<QXmppPubSubManager>();
Q_ASSERT_X(d->discoveryManager, "QXmppMixManager", "QXmppPubSubManager is missing");
Q_ASSERT_X(d->pubSubManager, "QXmppMixManager", "QXmppPubSubManager is missing");
}

void QXmppMixManager::onUnregistered(QXmppClient *client)
{
disconnect(d->discoveryManager, &QXmppDiscoveryManager::infoReceived, this, &QXmppMixManager::handleDiscoInfo);
resetCachedData();
disconnect(client, &QXmppClient::disconnected, this, nullptr);
disconnect(client, &QXmppClient::connected, this, nullptr);
}

bool QXmppMixManager::handlePubSubEvent(const QDomElement &element, const QString &pubSubService, const QString &nodeName)
Expand Down
2 changes: 1 addition & 1 deletion tests/qxmppmixmanager/tst_qxmppmixmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ void tst_QXmppMixManager::testOnUnregistered()
manager.setArchivingSupportedByServer(true);
manager.addService(service);

Q_EMIT client.disconnected();
Q_EMIT client.connected();
QVERIFY(manager.supportedByServer());
QVERIFY(manager.archivingSupportedByServer());
QVERIFY(!manager.services().isEmpty());
Expand Down

0 comments on commit acd49df

Please sign in to comment.