From 46f3831fd238b4c1fb10d44e4531d9e59d574c97 Mon Sep 17 00:00:00 2001 From: Linus Jahn Date: Sun, 22 Jan 2023 18:06:09 +0100 Subject: 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. --- src/omemo/QXmppOmemoManager.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/omemo/QXmppOmemoManager.cpp') 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> 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 Manager::removeContactDevices(const QStrin auto future = d->unsubscribeFromDeviceList(jid); future.then(this, [=](QXmppPubSubManager::Result result) mutable { - if (std::holds_alternative(result)) { + if (std::holds_alternative(result)) { warning("Contact '" % jid % "' could not be removed because the device list subscription could not be removed"); interface.finish(std::move(result)); } else { -- cgit v1.2.3