diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2023-01-08 02:32:40 +0100 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2023-01-08 02:32:40 +0100 |
commit | 0b8709a0ead4bdc71666f09860a058c90e3c7a1a (patch) | |
tree | 0aa4d04c2f626aff091ff6aad534e5a885d50468 /src/RoomDirectoryModel.h | |
parent | fd949f0b83498db576cecb6c056607c7c964dde7 (diff) |
Fix potential crash from the room directory
Diffstat (limited to 'src/RoomDirectoryModel.h')
-rw-r--r-- | src/RoomDirectoryModel.h | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/RoomDirectoryModel.h b/src/RoomDirectoryModel.h index 54938561..2c6a5bca 100644 --- a/src/RoomDirectoryModel.h +++ b/src/RoomDirectoryModel.h @@ -13,6 +13,24 @@ #include <mtx/responses/public_rooms.hpp> +class FetchRoomsChunkFromDirectoryJob final : public QObject +{ + Q_OBJECT + +public: + explicit FetchRoomsChunkFromDirectoryJob(QObject *p = nullptr) + : QObject(p) + { + } + +signals: + void fetchedRoomsBatch(std::vector<mtx::responses::PublicRoomsChunk> rooms, + const std::string &next_batch, + const std::string &search_term, + const std::string &server, + const std::string &since); +}; + class RoomDirectoryModel : public QAbstractListModel { Q_OBJECT @@ -55,8 +73,6 @@ public: Q_INVOKABLE void joinRoom(const int &index = -1); signals: - void fetchedRoomsBatch(std::vector<mtx::responses::PublicRoomsChunk> rooms, - const std::string &next_batch); void loadingMoreRoomsChanged(); void reachedEndOfPaginationChanged(); @@ -67,7 +83,10 @@ public slots: private slots: void displayRooms(std::vector<mtx::responses::PublicRoomsChunk> rooms, - const std::string &next_batch); + const std::string &next_batch, + const std::string &search_term, + const std::string &server, + const std::string &since); private: bool canJoinRoom(const QString &room) const; |