diff options
| author | Linus Jahn <lnj@kaidan.im> | 2022-12-30 23:35:47 +0100 |
|---|---|---|
| committer | Linus Jahn <lnj@kaidan.im> | 2022-12-30 23:35:47 +0100 |
| commit | 6efebe555d30170c2ecfc2372113f342c513b0c2 (patch) | |
| tree | 146535dd164abe60d28a020a2680e17c0de2b055 /src/base/QXmppStream.cpp | |
| parent | 93c35b3f1260f3dfafbc77609fcadb9a40a7b97f (diff) | |
| download | qxmpp-6efebe555d30170c2ecfc2372113f342c513b0c2.tar.gz | |
Replace QXmpp::SendError with QXmppError everywhere
Part of #501.
Diffstat (limited to 'src/base/QXmppStream.cpp')
| -rw-r--r-- | src/base/QXmppStream.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
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::IqResult> QXmppStream::sendIq(QXmppPacket &&packet, const Q using namespace QXmpp; if (id.isEmpty() || d->runningIqs.contains(id)) { - return makeReadyFuture<IqResult>(QXmpp::SendError { + return makeReadyFuture<IqResult>(QXmppError { QStringLiteral("Invalid IQ id: empty or in use."), SendError::Disconnected }); } if (to.isEmpty()) { - return makeReadyFuture<IqResult>(SendError { + return makeReadyFuture<IqResult>(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<SendError>(sendFuture.result())) { + if (std::holds_alternative<QXmppError>(sendFuture.result())) { // early exit (saves QFutureWatcher) - return makeReadyFuture<IqResult>(std::get<SendError>(sendFuture.result())); + return makeReadyFuture<IqResult>(std::get<QXmppError>(sendFuture.result())); } } else { awaitLast(sendFuture, this, [this, id](SendResult result) { - if (std::holds_alternative<SendError>(result)) { + if (std::holds_alternative<QXmppError>(result)) { if (auto itr = d->runningIqs.find(id); itr != d->runningIqs.end()) { - itr.value().interface.reportResult(std::get<SendError>(result)); + itr.value().interface.reportResult(std::get<QXmppError>(result)); itr.value().interface.reportFinished(); d->runningIqs.erase(itr); @@ -285,7 +285,7 @@ QFuture<QXmppStream::IqResult> 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(); |
