aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-11-09 00:08:53 +0100
committerdec05eba <dec05eba@protonmail.com>2020-11-09 00:08:53 +0100
commit4af367373f6f92b0fc1d79b2871fa942e1eb86fa (patch)
treedcf40ea78a8973069e3cbd5889c7a379a217b453 /plugins
parentf8748d14ea11d6d53ad46aee2832180daf05fb77 (diff)
Matrix: update user display name/avatar when updated in /sync; fix backspace search delay
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Matrix.hpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/plugins/Matrix.hpp b/plugins/Matrix.hpp
index 0248e09..362abeb 100644
--- a/plugins/Matrix.hpp
+++ b/plugins/Matrix.hpp
@@ -14,12 +14,15 @@ namespace QuickMedia {
struct UserInfo {
friend struct RoomData;
+ UserInfo(RoomData *room, std::string user_id);
+ UserInfo(RoomData *room, std::string user_id, std::string display_name, std::string avatar_url);
- std::string user_id;
+ RoomData *room;
+ const sf::Color display_name_color;
+ const std::string user_id;
+ private:
std::string display_name;
std::string avatar_url;
- sf::Color display_name_color;
- private:
std::string read_marker_event_id;
};
@@ -60,7 +63,14 @@ namespace QuickMedia {
void add_user(std::shared_ptr<UserInfo> user);
void set_user_read_marker(std::shared_ptr<UserInfo> &user, const std::string &event_id);
- std::string get_user_read_marker(std::shared_ptr<UserInfo> &user);
+ std::string get_user_read_marker(const std::shared_ptr<UserInfo> &user);
+
+ std::string get_user_display_name(const std::shared_ptr<UserInfo> &user);
+ std::string get_user_avatar_url(const std::shared_ptr<UserInfo> &user);
+
+ // Set to empty to remove (in which case the display name will be the user id)
+ void set_user_display_name(std::shared_ptr<UserInfo> &user, std::string display_name);
+ void set_user_avatar_url(std::shared_ptr<UserInfo> &user, std::string avatar_url);
// Ignores duplicates
void prepend_messages_reverse(const std::vector<std::shared_ptr<Message>> &new_messages);