diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-11-12 02:35:19 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-11-12 02:35:19 +0100 |
commit | 0df442e04c57dd80fc9a6b885b2ba86442b405b9 (patch) | |
tree | 853e0ea71330cb2939e4b0ec7a16515f4169c5a7 /plugins | |
parent | 01636191bc8ee0a109a50ca9441f01a14d273a02 (diff) |
Matrix: workaround synapse bug where sync doesn't include membership states when using messages filter
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Matrix.hpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/Matrix.hpp b/plugins/Matrix.hpp index 9371900..25225d7 100644 --- a/plugins/Matrix.hpp +++ b/plugins/Matrix.hpp @@ -12,6 +12,12 @@ namespace QuickMedia { struct RoomData; + enum class UserResolveState { + NOT_RESOLVED, + RESOLVING, + RESOLVED + }; + struct UserInfo { friend struct RoomData; UserInfo(RoomData *room, std::string user_id); @@ -20,6 +26,7 @@ namespace QuickMedia { RoomData *room; const sf::Color display_name_color; const std::string user_id; + UserResolveState resolve_state; private: std::string display_name; std::string avatar_url; @@ -37,6 +44,8 @@ namespace QuickMedia { MEMBERSHIP }; + bool is_visual_media_message_type(MessageType message_type); + enum class RelatedEventType { NONE, REPLY, @@ -110,6 +119,7 @@ namespace QuickMedia { // These 4 variables are set by QuickMedia, not the matrix plugin bool last_message_read = true; + bool users_fetched = false; time_t last_read_message_timestamp = 0; void *userdata = nullptr; // Pointer to BodyItem. Note: this has to be valid as long as the room is valid @@ -464,6 +474,8 @@ namespace QuickMedia { std::shared_ptr<Message> get_message_by_id(RoomData *room, const std::string &event_id); RoomData* get_room_by_id(const std::string &id); + void update_user_with_latest_state(RoomData *room, const std::string &user_id); + void update_room_users(RoomData *room); bool use_tor = false; private: |