aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-11-01 13:34:14 +0100
committerdec05eba <dec05eba@protonmail.com>2020-11-01 13:34:14 +0100
commit438729255b8d62ddac0688011e5fe9641db696f7 (patch)
treeab3873f185496bdd1bd1b21716545198401aeb0c /src
parent13935702620305c5baaf6403417cc75a9b706fea (diff)
Matrix: immediately remove room from gui on leave instead of waiting for sync response
Diffstat (limited to 'src')
-rw-r--r--src/plugins/Matrix.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp
index d143e9a..22c2447 100644
--- a/src/plugins/Matrix.cpp
+++ b/src/plugins/Matrix.cpp
@@ -2580,6 +2580,13 @@ namespace QuickMedia {
std::string server_response;
DownloadResult download_result = download_to_string(homeserver + "/_matrix/client/r0/rooms/" + room_id + "/leave", server_response, std::move(additional_args), use_tor, true);
+ if(download_result == DownloadResult::OK) {
+ RoomData *room = get_room_by_id(room_id);
+ if(!room) {
+ delegate->leave_room(room, LeaveType::LEAVE, "");
+ remove_room(room_id);
+ }
+ }
return download_result_to_plugin_result(download_result);
}