From 620123fbd6c18dc48a25cc735565f6d8d85f8639 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 26 Oct 2020 09:48:25 +0100 Subject: Matrix: add room tags Fix pinned events that are added after starting QuickMedia (before this change it adds all elements again to the list). Add /me command. Other fixes... --- include/QuickMedia.hpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'include/QuickMedia.hpp') diff --git a/include/QuickMedia.hpp b/include/QuickMedia.hpp index 45c499a..bdbafef 100644 --- a/include/QuickMedia.hpp +++ b/include/QuickMedia.hpp @@ -5,6 +5,7 @@ #include "Page.hpp" #include "Storage.hpp" #include "Tab.hpp" +#include "MessageQueue.hpp" #include #include #include @@ -14,10 +15,7 @@ #include #include #include -#include -#include #include -#include #include #include @@ -26,6 +24,8 @@ namespace QuickMedia { class FileManager; class MangaImagesPage; class ImageBoardThreadPage; + class RoomData; + class MatrixChatPage; enum class ImageViewMode { SINGLE, @@ -50,16 +50,19 @@ namespace QuickMedia { bool load_manga_content_storage(const char *service_name, const std::string &manga_title, const std::string &manga_id); void select_file(const std::string &filepath); + + bool is_window_focused(); + RoomData* get_current_chat_room(); private: void base_event_handler(sf::Event &event, PageType previous_page, Body *body, SearchBar *search_bar, bool handle_key_press = true, bool handle_searchbar = true); - void page_loop(std::vector tabs); + void page_loop(std::vector &tabs); void video_content_page(Page *page, std::string video_url, std::string video_title); // Returns -1 to go to previous chapter, 0 to stay on same chapter and 1 to go to next chapter int image_page(MangaImagesPage *images_page, Body *chapters_body); void image_continuous_page(MangaImagesPage *images_page); void image_board_thread_page(ImageBoardThreadPage *thread_page, Body *thread_body); void chat_login_page(); - void chat_page(); + void chat_page(MatrixChatPage *chat_page, RoomData *current_room); enum class LoadImageResult { OK, @@ -110,10 +113,8 @@ namespace QuickMedia { std::future autocomplete_future; std::future image_download_future; std::thread image_upscale_thead; - std::mutex image_upscale_mutex; - std::deque images_to_upscale; + MessageQueue images_to_upscale_queue; std::vector image_upscale_status; - std::condition_variable image_upscale_cv; std::string downloading_chapter_url; bool image_download_cancel = false; int exit_code = 0; @@ -127,5 +128,6 @@ namespace QuickMedia { ImageViewMode image_view_mode = ImageViewMode::SINGLE; std::vector selected_files; bool fit_image_to_window = false; + RoomData *current_chat_room = nullptr; }; } \ No newline at end of file -- cgit v1.2.3