diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-11-18 09:46:54 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-11-18 09:46:54 +0100 |
commit | 310f01adafd54b10e4d1278b67e75024c0bb09e4 (patch) | |
tree | 3eebd363d341ee8c78a1d801951e1e47e9680193 | |
parent | 053ffc2ea6cf22f2b4d1ab37805f57c48d114871 (diff) |
Matrix: fix for construct
-rw-r--r-- | src/plugins/Matrix.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp index 9998b48..67b30f7 100644 --- a/src/plugins/Matrix.cpp +++ b/src/plugins/Matrix.cpp @@ -3361,11 +3361,19 @@ namespace QuickMedia { const rapidjson::Value &avatar_url_json = GetMember(joined_obj.value, "avatar_url"); const rapidjson::Value &display_name_json = GetMember(joined_obj.value, "display_name"); + const rapidjson::Value &displayname_json = GetMember(joined_obj.value, "displayname"); // Construct bug... std::string user_id(joined_obj.name.GetString(), joined_obj.name.GetStringLength()); auto user = get_user_by_id(room, user_id); assert(user); - std::string display_name = display_name_json.IsString() ? display_name_json.GetString() : user_id; + std::string display_name; + if(display_name_json.IsString()) + display_name = display_name_json.GetString(); + else if(displayname_json.IsString()) + display_name = displayname_json.GetString(); + else + display_name = user_id; + std::string avatar_url; if(avatar_url_json.IsString()) avatar_url = std::string(avatar_url_json.GetString(), avatar_url_json.GetStringLength()); |