From 985530e99b62b253790ed808cf182afe0689af5e Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Thu, 5 Oct 2017 18:13:11 +0300 Subject: [PATCH] Resume sync when connectivity is established --- include/MatrixClient.h | 2 +- src/MatrixClient.cc | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/MatrixClient.h b/include/MatrixClient.h index cd023650..c87f0668 100644 --- a/include/MatrixClient.h +++ b/include/MatrixClient.h @@ -50,7 +50,7 @@ public: void fetchUserAvatar(const QString &userId, const QUrl &avatarUrl); void fetchOwnAvatar(const QUrl &avatar_url); void downloadImage(const QString &event_id, const QUrl &url); - void messages(const QString &room_id, const QString &from_token, int limit = 20) noexcept; + void messages(const QString &room_id, const QString &from_token, int limit = 30) noexcept; void uploadImage(const QString &roomid, const QString &filename); void joinRoom(const QString &roomIdOrAlias); void leaveRoom(const QString &roomId); diff --git a/src/MatrixClient.cc b/src/MatrixClient.cc index 82643797..8c10a0a2 100644 --- a/src/MatrixClient.cc +++ b/src/MatrixClient.cc @@ -44,6 +44,13 @@ MatrixClient::MatrixClient(QString server, QObject *parent) txn_id_ = settings.value("client/transaction_id", 1).toInt(); connect(this, SIGNAL(finished(QNetworkReply *)), this, SLOT(onResponse(QNetworkReply *))); + connect(this, + &QNetworkAccessManager::networkAccessibleChanged, + this, + [=](NetworkAccessibility status) { + if (status != NetworkAccessibility::Accessible) + setNetworkAccessible(NetworkAccessibility::Accessible); + }); } void