diff --git a/src/ChatPage.h b/src/ChatPage.h
index a29cea7b..da367c29 100644
--- a/src/ChatPage.h
+++ b/src/ChatPage.h
@@ -23,9 +23,10 @@
#include <variant>
#include <mtx/common.hpp>
-#include <mtx/requests.hpp>
-#include <mtx/responses.hpp>
-#include <mtxclient/http/errors.hpp>
+#include <mtx/events.hpp>
+#include <mtx/events/encrypted.hpp>
+#include <mtx/events/member.hpp>
+#include <mtx/events/presence.hpp>
#include <QFrame>
#include <QHBoxLayout>
@@ -37,11 +38,8 @@
#include "CacheCryptoStructs.h"
#include "CacheStructs.h"
-#include "CallManager.h"
#include "CommunitiesList.h"
-#include "Utils.h"
#include "notifications/Manager.h"
-#include "popups/UserMentions.h"
class OverlayModal;
class QuickSwitcher;
@@ -54,13 +52,25 @@ class UserInfoWidget;
class UserSettings;
class NotificationsManager;
class TimelineModel;
+class CallManager;
constexpr int CONSENSUS_TIMEOUT = 1000;
constexpr int SHOW_CONTENT_TIMEOUT = 3000;
constexpr int TYPING_REFRESH_TIMEOUT = 10000;
-namespace mtx::http {
-using RequestErr = const std::optional<mtx::http::ClientError> &;
+namespace mtx::requests {
+struct CreateRoom;
+}
+namespace mtx::responses {
+struct Notifications;
+struct Sync;
+struct Timeline;
+struct Rooms;
+struct LeftRoom;
+}
+
+namespace popups {
+class UserMentions;
}
class ChatPage : public QWidget
@@ -89,8 +99,6 @@ public:
//! Show the room/group list (if it was visible).
void showSideBars();
void initiateLogout();
- void query_keys(const std::string &req,
- std::function<void(const UserKeyCache &, mtx::http::RequestErr)> cb);
void focusMessageInput();
QString status() const;
@@ -145,7 +153,7 @@ signals:
void trySyncCb();
void tryDelayedSyncCb();
void tryInitialSyncCb();
- void newSyncResponse(mtx::responses::Sync res);
+ void newSyncResponse(const mtx::responses::Sync &res);
void leftRoom(const QString &room_id);
void initializeRoomList(QMap<QString, RoomInfo>);
@@ -194,14 +202,11 @@ private slots:
void joinRoom(const QString &room);
void sendTypingNotifications();
- void handleSyncResponse(mtx::responses::Sync res);
+ void handleSyncResponse(const mtx::responses::Sync &res);
private:
static ChatPage *instance_;
- //! Handler callback for initial sync. It doesn't run on the main thread so all
- //! communication with the GUI should be done through signals.
- void initialSyncHandler(const mtx::responses::Sync &res, mtx::http::RequestErr err);
void startInitialSync();
void tryInitialSync();
void trySync();
@@ -276,7 +281,7 @@ private:
QSharedPointer<UserSettings> userSettings_;
NotificationsManager notificationsManager;
- CallManager callManager_;
+ CallManager *callManager_;
};
template<class Collection>
|