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/omemo/QXmppOmemoManager.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/omemo/QXmppOmemoManager.cpp') diff --git a/src/omemo/QXmppOmemoManager.cpp b/src/omemo/QXmppOmemoManager.cpp index 856e00a5..11a7ec36 100644 --- a/src/omemo/QXmppOmemoManager.cpp +++ b/src/omemo/QXmppOmemoManager.cpp @@ -1030,10 +1030,10 @@ QFuture Manager::encryptIq(QXmppIq &&iq, co QFutureInterface interface(QFutureInterfaceBase::Started); if (!d->isStarted) { - QXmpp::SendError error; - error.text = QStringLiteral("OMEMO manager must be started before encrypting"); - error.type = QXmpp::SendError::EncryptionError; - reportFinishedResult(interface, { error }); + interface.reportResult(QXmppError { + QStringLiteral("OMEMO manager must be started before encrypting"), + SendError::EncryptionError }); + interface.reportFinished(); } else { std::optional acceptedTrustLevels; @@ -1048,10 +1048,10 @@ QFuture Manager::encryptIq(QXmppIq &&iq, co auto future = d->encryptStanza(iq, { QXmppUtils::jidToBareJid(iq.to()) }, *acceptedTrustLevels); await(future, this, [=, iq = std::move(iq)](std::optional omemoElement) mutable { if (!omemoElement) { - QXmpp::SendError error; - error.text = QStringLiteral("OMEMO element could not be created"); - error.type = QXmpp::SendError::EncryptionError; - reportFinishedResult(interface, { error }); + interface.reportResult(QXmppError { + QStringLiteral("OMEMO element could not be created"), + SendError::EncryptionError }); + interface.reportFinished(); } else { QXmppOmemoIq omemoIq; omemoIq.setId(iq.id()); @@ -1077,7 +1077,7 @@ QFuture Manager::decryptIq(const QDomElemen { if (!d->isStarted) { // TODO: Add decryption queue to avoid this error - return makeReadyFuture(SendError { + return makeReadyFuture(QXmppError { QStringLiteral("OMEMO manager must be started before decrypting"), SendError::EncryptionError }); } @@ -1088,7 +1088,7 @@ QFuture Manager::decryptIq(const QDomElemen if (result) { return result->iq; } - return SendError { + return QXmppError { QStringLiteral("OMEMO message could not be decrypted"), SendError::EncryptionError }; -- cgit v1.2.3