diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-01-10 22:54:27 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-01-10 22:54:27 +0100 |
commit | ebfa5dd2bc68c3db57bd27aa855d6524d4a531d9 (patch) | |
tree | 7e8e18ab36579669b87b243cc776867b830778a7 /src | |
parent | e810d1382fc5763a0914d915f9382f997034eb91 (diff) |
Withdraw invite message
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/Matrix.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp index 27c9390..df72fc9 100644 --- a/src/plugins/Matrix.cpp +++ b/src/plugins/Matrix.cpp @@ -1896,32 +1896,35 @@ namespace QuickMedia { } } else if(strcmp(membership_json.GetString(), "leave") == 0) { if(sent_by_somebody_else) { - bool unbanned = false; + bool known_action = false; if(unsigned_json.IsObject()) { const rapidjson::Value &prev_content_json = GetMember(unsigned_json, "prev_content"); if(prev_content_json.IsObject()) { const rapidjson::Value &prev_membership_json = GetMember(prev_content_json, "membership"); if(prev_membership_json.IsString() && strcmp(prev_membership_json.GetString(), "ban") == 0) { body = user_display_name + " was unbanned from the room by " + sender_display_name; - unbanned = true; + known_action = true; + } else if(prev_membership_json.IsString() && strcmp(prev_membership_json.GetString(), "invite") == 0) { + body = sender_display_name + " withdrew " + user_display_name + "'s invitation"; + known_action = true; } } } - if(!unbanned) + if(!known_action) body = user_display_name + " was kicked from the room by " + sender_display_name; } else { - bool invite = false; + bool known_action = false; if(unsigned_json.IsObject()) { const rapidjson::Value &prev_content_json = GetMember(unsigned_json, "prev_content"); if(prev_content_json.IsObject()) { const rapidjson::Value &prev_membership_json = GetMember(prev_content_json, "membership"); if(prev_membership_json.IsString() && strcmp(prev_membership_json.GetString(), "invite") == 0) { body = user_display_name + " rejected the invitation"; - invite = true; + known_action = true; } } } - if(!invite) + if(!known_action) body = user_display_name + " left the room"; } if(!reason_str.empty()) |