diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-04-18 17:18:31 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-04-18 17:18:31 +0200 |
commit | 7f0bdeddb79c308ab082a124441f1d69d665dbfc (patch) | |
tree | 66428f87349b6bfe6f4d50fec871c358a32717f9 /plugins | |
parent | 033fbf3f1363c810d115ce9a531aea26ea9e1cf1 (diff) |
Fix misc matrix bugs related to leaving a room when side panel is visible and changing room, misc visual changes to manga
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/MangaGeneric.hpp | 8 | ||||
-rw-r--r-- | plugins/Matrix.hpp | 12 |
2 files changed, 15 insertions, 5 deletions
diff --git a/plugins/MangaGeneric.hpp b/plugins/MangaGeneric.hpp index 4c99909..98d06d8 100644 --- a/plugins/MangaGeneric.hpp +++ b/plugins/MangaGeneric.hpp @@ -18,6 +18,11 @@ namespace QuickMedia { const char *url_contains = nullptr; }; + struct DescriptionQuery { + const char *html_query = nullptr; + const char *field_name = nullptr; + }; + // If |field_contains| is null, then any matching query is added. If |field_name| is "text", then the inner text is used. struct ThumbnailQuery { const char *html_query = nullptr; @@ -98,6 +103,8 @@ namespace QuickMedia { // This is required. MangaGenericSearchPage& text_handler(std::vector<TextQuery> queries); // This is optional. + MangaGenericSearchPage& description_handler(std::vector<DescriptionQuery> queries); + // This is optional. MangaGenericSearchPage& thumbnail_handler(std::vector<ThumbnailQuery> queries); // If |url_contains| is null, then any matching query is added. If |title_field| is "text", then the inner text is used. @@ -132,6 +139,7 @@ namespace QuickMedia { bool fail_on_http_error; SearchQuery search_query; std::vector<TextQuery> text_queries; + std::vector<DescriptionQuery> description_queries; std::vector<ThumbnailQuery> thumbnail_queries; ListChaptersQuery list_chapters_query; ListPageQuery list_page_query; diff --git a/plugins/Matrix.hpp b/plugins/Matrix.hpp index 974238f..0659983 100644 --- a/plugins/Matrix.hpp +++ b/plugins/Matrix.hpp @@ -235,7 +235,7 @@ namespace QuickMedia { virtual void add_unread_notification(RoomData *room, std::string event_id, std::string sender, std::string body) = 0; - virtual void update(MatrixPageType page_type) { (void)page_type; } + virtual void update(MatrixPageType page_type, Body *chat_body, bool messages_tab_visible) { (void)page_type; } virtual void clear_data() = 0; }; @@ -261,7 +261,7 @@ namespace QuickMedia { void add_unread_notification(RoomData *room, std::string event_id, std::string sender, std::string body) override; - void update(MatrixPageType page_type) override; + void update(MatrixPageType page_type, Body *chat_body, bool messages_tab_visible) override; void clear_data() override; @@ -271,8 +271,8 @@ namespace QuickMedia { MatrixRoomTagsPage *room_tags_page; MatrixInvitesPage *invites_page; private: - void update_room_description(RoomData *room, Messages &new_messages, bool is_initial_sync, bool sync_is_cache); - void update_pending_room_messages(MatrixPageType page_type); + void update_room_description(RoomData *room, Messages &new_messages, bool is_initial_sync, bool sync_is_cache, Body *chat_body, bool messages_tab_visible); + void update_pending_room_messages(MatrixPageType page_type, Body *chat_body, bool messages_tab_visible); private: struct RoomMessagesData { Messages messages; @@ -440,9 +440,11 @@ namespace QuickMedia { void update() override; const std::string room_id; - MatrixQuickMedia *matrix_delegate = nullptr; MatrixRoomsPage *rooms_page = nullptr; bool should_clear_data = false; + + Body *chat_body = nullptr; + bool messages_tab_visible = false; }; class MatrixRoomDirectoryPage : public Page { |