Resume sync when connectivity is established

remotes/origin/HEAD
Konstantinos Sideris 7 years ago
parent 1fc68c5b7f
commit 985530e99b
  1. 2
      include/MatrixClient.h
  2. 7
      src/MatrixClient.cc

@ -50,7 +50,7 @@ public:
void fetchUserAvatar(const QString &userId, const QUrl &avatarUrl); void fetchUserAvatar(const QString &userId, const QUrl &avatarUrl);
void fetchOwnAvatar(const QUrl &avatar_url); void fetchOwnAvatar(const QUrl &avatar_url);
void downloadImage(const QString &event_id, const QUrl &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 uploadImage(const QString &roomid, const QString &filename);
void joinRoom(const QString &roomIdOrAlias); void joinRoom(const QString &roomIdOrAlias);
void leaveRoom(const QString &roomId); void leaveRoom(const QString &roomId);

@ -44,6 +44,13 @@ MatrixClient::MatrixClient(QString server, QObject *parent)
txn_id_ = settings.value("client/transaction_id", 1).toInt(); txn_id_ = settings.value("client/transaction_id", 1).toInt();
connect(this, SIGNAL(finished(QNetworkReply *)), this, SLOT(onResponse(QNetworkReply *))); connect(this, SIGNAL(finished(QNetworkReply *)), this, SLOT(onResponse(QNetworkReply *)));
connect(this,
&QNetworkAccessManager::networkAccessibleChanged,
this,
[=](NetworkAccessibility status) {
if (status != NetworkAccessibility::Accessible)
setNetworkAccessible(NetworkAccessibility::Accessible);
});
} }
void void

Loading…
Cancel
Save