aboutsummaryrefslogtreecommitdiff
path: root/lib/mxcreply.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mxcreply.cpp')
-rw-r--r--lib/mxcreply.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/mxcreply.cpp b/lib/mxcreply.cpp
index f389ac85..7819367e 100644
--- a/lib/mxcreply.cpp
+++ b/lib/mxcreply.cpp
@@ -4,6 +4,7 @@
#include "mxcreply.h"
#include <QtCore/QBuffer>
+#include <QtCore/QTimer>
#include "connection.h"
#include "room.h"
#include "networkaccessmanager.h"
@@ -40,6 +41,20 @@ MxcReply::MxcReply(QNetworkReply* reply, Room* room, const QString &eventId)
});
}
+MxcReply::MxcReply()
+{
+ QTimer::singleShot(0, this, [this](){
+ setError(QNetworkReply::ProtocolInvalidOperationError, QStringLiteral("Invalid Request"));
+ setFinished(true);
+#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
+ Q_EMIT errorOccurred(QNetworkReply::ProtocolInvalidOperationError);
+#else
+ Q_EMIT error(QNetworkReply::ProtocolInvalidOperationError);
+#endif
+ Q_EMIT finished();
+ });
+}
+
bool MxcReply::isSequential() const
{
return true;