diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-02-09 15:29:29 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-02-09 15:29:29 +0100 |
commit | 2e22afbaa5c01d9aa40564a7646092455ce0d88c (patch) | |
tree | e27dbad9eacc7732b1fad1dd44f075144da332b9 /plugins | |
parent | bc7ef0c3fab69c4ef47aa8f50da9f5818d00bc88 (diff) |
Matrix: put an end to my unread messages misery
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Matrix.hpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/Matrix.hpp b/plugins/Matrix.hpp index 09500a6..08be8e1 100644 --- a/plugins/Matrix.hpp +++ b/plugins/Matrix.hpp @@ -150,6 +150,7 @@ namespace QuickMedia { std::atomic_int64_t last_message_timestamp = 0; std::atomic_int unread_notification_count = 0; + std::atomic_int64_t read_marker_event_timestamp = 0; size_t index = 0; private: @@ -473,7 +474,7 @@ namespace QuickMedia { PluginResult on_start_typing(RoomData *room); PluginResult on_stop_typing(RoomData *room); - PluginResult set_read_marker(RoomData *room, const std::string &event_id); + PluginResult set_read_marker(RoomData *room, const std::string &event_id, int64_t event_timestamp); PluginResult join_room(const std::string &room_id); PluginResult leave_room(const std::string &room_id); @@ -497,6 +498,8 @@ namespace QuickMedia { bool use_tor = false; private: + PluginResult set_qm_last_read_message_timestamp(RoomData *room, int64_t timestamp); + PluginResult parse_sync_response(const rapidjson::Document &root, bool is_additional_messages_sync, bool initial_sync); PluginResult parse_notifications(const rapidjson::Value ¬ifications_json); PluginResult parse_sync_account_data(const rapidjson::Value &account_data_json, std::optional<std::set<std::string>> &dm_rooms); |