aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
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);