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