aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-11-09 21:14:45 +0100
committerdec05eba <dec05eba@protonmail.com>2020-11-09 21:14:45 +0100
commite8085267aeb23e33fd5cdbc2e4b6d43c64cc7a78 (patch)
treed25fa3a717836e101597f0f2e30cf8395593c2e4 /src/plugins
parent92a53f252d4ef90aed1e239436afcce4dba9165e (diff)
Matrix: show number of pinned messages in tab, show previous displayname in name change
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/Matrix.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp
index 9a64bda..a90bb30 100644
--- a/src/plugins/Matrix.cpp
+++ b/src/plugins/Matrix.cpp
@@ -1779,7 +1779,12 @@ namespace QuickMedia {
const rapidjson::Value &new_avatar_url_json = GetMember(*content_json, "avatar_url");
if(new_displayname_json.IsString() && (!prev_displayname_json.IsString() || strcmp(new_displayname_json.GetString(), prev_displayname_json.GetString()) != 0)) {
std::string new_displayname_str = std::string(new_displayname_json.GetString());
- body = user_display_name + " changed their display name to " + new_displayname_str;
+ std::string prev_displayname_str;
+ if(prev_displayname_json.IsString())
+ prev_displayname_str = std::string(prev_displayname_json.GetString(), prev_displayname_json.GetStringLength());
+ else
+ prev_displayname_str = sender_json_str;
+ body = prev_displayname_str + " changed their display name to " + new_displayname_str;
room_data->set_user_display_name(user, std::move(new_displayname_str));
} else if(!new_displayname_json.IsString() && prev_displayname_json.IsString()) {
body = user_display_name + " removed their display name";