From b60554b8fdf42dc55cddcee059942096420c3e47 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Thu, 8 Feb 2018 19:07:58 +0200 Subject: Add a timeout timer for initial sync (#223, #222) Show a better message on the login screen after an initial sync failure. --- include/ChatPage.h | 5 ++++- include/MatrixClient.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/ChatPage.h b/include/ChatPage.h index 3cc6e6c8..dcd925e7 100644 --- a/include/ChatPage.h +++ b/include/ChatPage.h @@ -127,6 +127,8 @@ private: template void updateUserMetadata(const std::vector &collection); + void retryInitialSync(); + QHBoxLayout *topLayout_; Splitter *splitter; @@ -156,6 +158,7 @@ private: QTimer *showContentTimer_; QTimer *consensusTimer_; QTimer *syncTimeoutTimer_; + QTimer *initialSyncTimer_; QString current_room_; QString current_community_; @@ -191,7 +194,7 @@ private: // If the number of failures exceeds a certain threshold we // return to the login page. - int initialSyncFailures = 0; + int initialSyncFailures_ = 0; }; template diff --git a/include/MatrixClient.h b/include/MatrixClient.h index 7ae3fdf6..3efd2d0a 100644 --- a/include/MatrixClient.h +++ b/include/MatrixClient.h @@ -129,7 +129,7 @@ signals: void getOwnProfileResponse(const QUrl &avatar_url, const QString &display_name); void getOwnCommunitiesResponse(const QList &own_communities); void initialSyncCompleted(const mtx::responses::Sync &response); - void initialSyncFailed(const QString &msg); + void initialSyncFailed(); void syncCompleted(const mtx::responses::Sync &response); void syncFailed(const QString &msg); void joinFailed(const QString &msg); -- cgit 1.5.1