diff options
-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()); |