aboutsummaryrefslogtreecommitdiff
path: root/plugins/Matrix.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Matrix.hpp')
-rw-r--r--plugins/Matrix.hpp18
1 files changed, 13 insertions, 5 deletions
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;