Resume sync when connectivity is established

This commit is contained in:
Konstantinos Sideris 2017-10-05 18:13:11 +03:00
parent 1fc68c5b7f
commit 985530e99b
2 changed files with 8 additions and 1 deletions

View file

@ -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);

View file

@ -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