From 6efebe555d30170c2ecfc2372113f342c513b0c2 Mon Sep 17 00:00:00 2001 From: Linus Jahn Date: Fri, 30 Dec 2022 23:35:47 +0100 Subject: Replace QXmpp::SendError with QXmppError everywhere Part of #501. --- src/base/QXmppStream.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/base/QXmppStream.cpp') diff --git a/src/base/QXmppStream.cpp b/src/base/QXmppStream.cpp index c650b8ac..cbe40b8a 100644 --- a/src/base/QXmppStream.cpp +++ b/src/base/QXmppStream.cpp @@ -238,28 +238,28 @@ QFuture QXmppStream::sendIq(QXmppPacket &&packet, const Q using namespace QXmpp; if (id.isEmpty() || d->runningIqs.contains(id)) { - return makeReadyFuture(QXmpp::SendError { + return makeReadyFuture(QXmppError { QStringLiteral("Invalid IQ id: empty or in use."), SendError::Disconnected }); } if (to.isEmpty()) { - return makeReadyFuture(SendError { + return makeReadyFuture(QXmppError { QStringLiteral("The 'to' address must be set so the stream can match the response."), SendError::Disconnected }); } auto sendFuture = send(std::move(packet)); if (sendFuture.isFinished()) { - if (std::holds_alternative(sendFuture.result())) { + if (std::holds_alternative(sendFuture.result())) { // early exit (saves QFutureWatcher) - return makeReadyFuture(std::get(sendFuture.result())); + return makeReadyFuture(std::get(sendFuture.result())); } } else { awaitLast(sendFuture, this, [this, id](SendResult result) { - if (std::holds_alternative(result)) { + if (std::holds_alternative(result)) { if (auto itr = d->runningIqs.find(id); itr != d->runningIqs.end()) { - itr.value().interface.reportResult(std::get(result)); + itr.value().interface.reportResult(std::get(result)); itr.value().interface.reportFinished(); d->runningIqs.erase(itr); @@ -285,7 +285,7 @@ QFuture QXmppStream::sendIq(QXmppPacket &&packet, const Q void QXmppStream::cancelOngoingIqs() { for (auto &state : d->runningIqs) { - state.interface.reportResult(QXmpp::SendError { + state.interface.reportResult(QXmppError { QStringLiteral("IQ has been cancelled."), QXmpp::SendError::Disconnected }); state.interface.reportFinished(); -- cgit v1.2.3