diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/LocalAnime.hpp | 1 | ||||
-rw-r--r-- | plugins/Matrix.hpp | 18 | ||||
-rw-r--r-- | plugins/Page.hpp | 1 |
3 files changed, 15 insertions, 5 deletions
diff --git a/plugins/LocalAnime.hpp b/plugins/LocalAnime.hpp index 708cf45..7ab4119 100644 --- a/plugins/LocalAnime.hpp +++ b/plugins/LocalAnime.hpp @@ -12,6 +12,7 @@ namespace QuickMedia { using LocalAnimeItem = std::variant<LocalAnime, LocalAnimeSeason, LocalAnimeEpisode>; struct LocalAnimeEpisode { + std::string name; Path path; time_t modified_time_seconds = 0; }; diff --git a/plugins/Matrix.hpp b/plugins/Matrix.hpp index a3ce633..f8b10ae 100644 --- a/plugins/Matrix.hpp +++ b/plugins/Matrix.hpp @@ -18,7 +18,7 @@ namespace QuickMedia { struct RoomData; struct Message; - static const int AUTHOR_MAX_LENGTH = 48; + static const int AUTHOR_MAX_LENGTH = 192; class Matrix; @@ -320,7 +320,7 @@ namespace QuickMedia { virtual ~MatrixDelegate() = default; virtual void join_room(RoomData *room) = 0; - virtual void leave_room(RoomData *room, LeaveType leave_type, const std::string &reason) = 0; + virtual void leave_room(RoomData *room, const std::string &event_id, LeaveType leave_type, const std::string &reason) = 0; // Note: calling |room| methods inside this function is not allowed virtual void room_add_tag(RoomData *room, const std::string &tag) = 0; @@ -356,7 +356,7 @@ namespace QuickMedia { MatrixQuickMedia(Program *program, Matrix *matrix, MatrixRoomsPage *rooms_page, MatrixRoomTagsPage *room_tags_page, MatrixInvitesPage *invites_page, MatrixNotificationsPage *notifications_page); void join_room(RoomData *room) override; - void leave_room(RoomData *room, LeaveType leave_type, const std::string &reason) override; + void leave_room(RoomData *room, const std::string &event_id, LeaveType leave_type, const std::string &reason) override; void room_add_tag(RoomData *room, const std::string &tag) override; void room_remove_tag(RoomData *room, const std::string &tag) override; void room_add_new_messages(RoomData *room, const Messages &messages, bool is_initial_sync, MessageDirection message_dir) override; @@ -548,8 +548,9 @@ namespace QuickMedia { class MatrixVideoPage : public VideoPage { public: MatrixVideoPage(Program *program, std::string filename) : VideoPage(program, ""), filename(std::move(filename)) {} - const char* get_title() const override { return ""; } - std::string get_filename() override { return filename; } + const char* get_title() const override; + std::string get_filename() override; + std::string get_download_url_for_clipboard(int max_height) override; private: std::string filename; }; @@ -759,6 +760,11 @@ namespace QuickMedia { MatrixDelegate* get_delegate(); + bool is_another_instance_running() const { return matrix_instance_already_running; } + + void mark_other_notification_as_read(const std::string &event_id); + bool is_other_notification_read(const std::string &event_id) const; + // Calls the |MatrixDelegate| pending events. // Should be called from the main (ui) thread void update(); @@ -783,6 +789,7 @@ namespace QuickMedia { void add_new_invites(); void parse_custom_emoji(const rapidjson::Value &custom_emoji_json); void load_custom_emoji_from_cache(); + void load_other_notifications(); PluginResult get_previous_room_messages(RoomData *room_data, bool latest_messages, size_t &num_new_messages, bool *reached_end = nullptr); void events_add_user_info(const rapidjson::Value &events_json, RoomData *room_data, int64_t timestamp); std::shared_ptr<UserInfo> parse_user_info(const rapidjson::Value &json, const std::string &user_id, RoomData *room_data, int64_t timestamp); @@ -850,6 +857,7 @@ namespace QuickMedia { std::unordered_map<std::string, CustomEmoji> custom_emoji_by_key; std::unordered_set<std::string> silenced_invites; std::unordered_map<std::string, int64_t> qm_read_markers_by_room_cache; + std::unordered_set<std::string> other_notifications_read; MessageQueue<std::shared_ptr<MatrixChatBodyDecryptJob>> decrypt_task; std::thread decrypt_thread; diff --git a/plugins/Page.hpp b/plugins/Page.hpp index 044759a..9e844b3 100644 --- a/plugins/Page.hpp +++ b/plugins/Page.hpp @@ -165,6 +165,7 @@ namespace QuickMedia { virtual void set_url(std::string new_url) { url = std::move(new_url); } std::string get_url() { return url; } virtual std::string get_download_url(int max_height) { (void)max_height; return url; } + virtual std::string get_download_url_for_clipboard(int max_height) { return get_download_url(max_height); } // Returns empty string for no timestamp or if the video doesn't support timestamps. // Timestamp is in seconds. virtual std::string get_url_timestamp() { return ""; } |