aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-05-21 01:36:00 +0200
committerdec05eba <dec05eba@protonmail.com>2021-05-21 01:36:00 +0200
commit0b0ab1e5a451cdd6ae5fd2166314037c1997d292 (patch)
tree58887c84994572acfeb923445cca46fa7a8eaac7 /plugins
parentdaa6574a80a37d50dad3c6f5ca94a4f974451729 (diff)
Jump to room when submitting notification
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Matrix.hpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/plugins/Matrix.hpp b/plugins/Matrix.hpp
index bcb4058..1c71733 100644
--- a/plugins/Matrix.hpp
+++ b/plugins/Matrix.hpp
@@ -213,7 +213,7 @@ namespace QuickMedia {
bool message_contains_user_mention(const std::string &msg, const std::string &username);
bool message_is_timeline(Message *message);
- void body_set_selected_item(Body *body, BodyItem *selected_item);
+ void body_set_selected_item_by_url(Body *body, const std::string &url);
std::string create_transaction_id();
enum class MatrixPageType {
@@ -312,7 +312,7 @@ namespace QuickMedia {
class MatrixRoomsPage : public Page {
public:
- MatrixRoomsPage(Program *program, Body *body, std::string title, MatrixRoomTagsPage *room_tags_page);
+ MatrixRoomsPage(Program *program, Body *body, std::string title, MatrixRoomTagsPage *room_tags_page, SearchBar *search_bar);
~MatrixRoomsPage() override;
const char* get_title() const override { return title.c_str(); }
@@ -330,14 +330,17 @@ namespace QuickMedia {
void set_room_as_read(RoomData *room);
+ void clear_search();
+
void clear_data();
MatrixQuickMedia *matrix_delegate = nullptr;
- private:
Body *body = nullptr;
+ private:
std::string title;
MatrixRoomTagsPage *room_tags_page = nullptr;
MatrixChatPage *current_chat_page = nullptr;
+ SearchBar *search_bar;
};
class MatrixRoomTagsPage : public Page {
@@ -477,20 +480,21 @@ namespace QuickMedia {
class MatrixNotificationsPage : public LazyFetchPage {
public:
- MatrixNotificationsPage(Program *program, Matrix *matrix, Body *notifications_body);
+ MatrixNotificationsPage(Program *program, Matrix *matrix, Body *notifications_body, MatrixRoomsPage *all_rooms_page);
const char* get_title() const override { return "Notifications"; }
- PluginResult submit(const std::string&, const std::string&, std::vector<Tab>&) override {
- return PluginResult::OK;
- }
+ PluginResult submit(const std::string&, const std::string&, std::vector<Tab>&) override;
PluginResult get_page(const std::string &str, int page, BodyItems &result_items) override;
PluginResult lazy_fetch(BodyItems &result_items) override;
bool is_ready() override;
+ bool submit_is_async() override { return false; }
+ bool clear_search_after_submit() override { return true; }
void add_notification(MatrixNotification notification);
void set_room_as_read(RoomData *room);
private:
Matrix *matrix;
Body *notifications_body;
+ MatrixRoomsPage *all_rooms_page;
};
class Matrix {