diff --git a/client/timelinewidget.cpp b/client/timelinewidget.cpp index f09bfc61..e04b8e90 100644 --- a/client/timelinewidget.cpp +++ b/client/timelinewidget.cpp @@ -26,6 +26,11 @@ using Quotient::operator""_ls; +QNetworkAccessManager* TimelineWidget::NamFactory::create(QObject* parent) +{ + return new Quotient::NetworkAccessManager(parent); +} + TimelineWidget::TimelineWidget(ChatRoomWidget* chatRoomWidget) : QQuickWidget(chatRoomWidget) , m_messageModel(new MessageEventModel(this)) @@ -45,6 +50,7 @@ TimelineWidget::TimelineWidget(ChatRoomWidget* chatRoomWidget) setResizeMode(SizeRootObjectToView); engine()->addImageProvider("thumbnail"_ls, makeThumbnailProvider(this)); + engine()->setNetworkAccessManagerFactory(&namFactory); auto* ctxt = rootContext(); ctxt->setContextProperty("messageModel"_ls, m_messageModel); diff --git a/client/timelinewidget.h b/client/timelinewidget.h index e9cc7078..da6f7c6d 100644 --- a/client/timelinewidget.h +++ b/client/timelinewidget.h @@ -4,7 +4,9 @@ #include +#include #include + #include class ChatRoomWidget; @@ -55,6 +57,12 @@ public slots: ActivityDetector activityDetector; ChatRoomWidget* roomWidget; + class NamFactory : public QQmlNetworkAccessManagerFactory { + public: + QNetworkAccessManager* create(QObject* parent) override; + }; + NamFactory namFactory; + void reStartShownTimer(); void timerEvent(QTimerEvent* qte) override; bool pendingMarkRead() const;