From 310f01adafd54b10e4d1278b67e75024c0bb09e4 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 18 Nov 2020 09:46:54 +0100 Subject: Matrix: fix for construct --- src/plugins/Matrix.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') 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()); -- cgit v1.2.3