diff options
| author | Linus Jahn <lnj@kaidan.im> | 2023-01-22 18:06:09 +0100 |
|---|---|---|
| committer | Linus Jahn <lnj@kaidan.im> | 2023-01-22 18:10:44 +0100 |
| commit | 46f3831fd238b4c1fb10d44e4531d9e59d574c97 (patch) | |
| tree | f21c85c98502ef3821d52ee4964060a2c49885d2 /src/omemo/QXmppOmemoManager.cpp | |
| parent | df37c35aa443e6ca7e3baad5f1bbeb379063df55 (diff) | |
| download | qxmpp-46f3831fd238b4c1fb10d44e4531d9e59d574c97.tar.gz | |
Use QXmppError in all IQ results instead of StanzaError
This allows us to report different error types with more information and
makes it possible to distinguish stanza errors and errors generated
locally.
Part of #501.
Diffstat (limited to 'src/omemo/QXmppOmemoManager.cpp')
| -rw-r--r-- | src/omemo/QXmppOmemoManager.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/omemo/QXmppOmemoManager.cpp b/src/omemo/QXmppOmemoManager.cpp index a90e3f53..af12879c 100644 --- a/src/omemo/QXmppOmemoManager.cpp +++ b/src/omemo/QXmppOmemoManager.cpp @@ -22,7 +22,6 @@ using namespace QXmpp; using namespace QXmpp::Private; using namespace QXmpp::Omemo::Private; -using Error = QXmppStanza::Error; using Manager = QXmppOmemoManager; using ManagerPrivate = QXmppOmemoManagerPrivate; @@ -629,8 +628,7 @@ QXmppTask<QVector<Manager::DevicesResult>> Manager::subscribeToDeviceLists(const state->jidsCount = jids.size(); for (const auto &jid : jids) { - auto future = d->subscribeToDeviceList(jid); - future.then(this, [state, jid](QXmppPubSubManager::Result result) mutable { + d->subscribeToDeviceList(jid).then(this, [state, jid](QXmppPubSubManager::Result result) mutable { Manager::DevicesResult devicesResult; devicesResult.jid = jid; devicesResult.result = result; @@ -759,7 +757,7 @@ QXmppTask<QXmppPubSubManager::Result> Manager::removeContactDevices(const QStrin auto future = d->unsubscribeFromDeviceList(jid); future.then(this, [=](QXmppPubSubManager::Result result) mutable { - if (std::holds_alternative<QXmppStanza::Error>(result)) { + if (std::holds_alternative<QXmppError>(result)) { warning("Contact '" % jid % "' could not be removed because the device list subscription could not be removed"); interface.finish(std::move(result)); } else { |
