aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Matrix.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-06-25 13:11:25 +0200
committerdec05eba <dec05eba@protonmail.com>2021-06-25 13:11:29 +0200
commit26134d3601c3c139aff71123b09bf18ba35b6450 (patch)
tree715e15cc4107a7aaf188b78b322e3fbe6cf5c073 /src/plugins/Matrix.cpp
parent38202de4f953fca28aa884246ced0aadf0d25a4d (diff)
Matrix: do not show kick/ban notification when restarting quickmedia (do not show notification on cache load)
Diffstat (limited to 'src/plugins/Matrix.cpp')
-rw-r--r--src/plugins/Matrix.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp
index 9f5faf0..cd4f637 100644
--- a/src/plugins/Matrix.cpp
+++ b/src/plugins/Matrix.cpp
@@ -375,11 +375,11 @@ namespace QuickMedia {
rooms_page->add_body_item(body_item);
}
- void MatrixQuickMedia::leave_room(RoomData *room, LeaveType leave_type, const std::string &reason) {
+ void MatrixQuickMedia::leave_room(RoomData *room, LeaveType leave_type, const std::string &reason, bool is_cache) {
room_body_item_by_room.erase(room);
rooms_page->remove_body_item_by_room_id(room->id);
room_tags_page->remove_body_item_by_room_id(room->id);
- if(leave_type != LeaveType::LEAVE)
+ if(!is_cache && leave_type != LeaveType::LEAVE)
show_notification("QuickMedia", reason);
}
@@ -1752,7 +1752,7 @@ namespace QuickMedia {
for(auto &room : rooms) {
if(existing_rooms.find(room.get()) == existing_rooms.end()) {
RoomData *room_p = room.get();
- ui_thread_tasks.push([this, room_p]{ delegate->leave_room(room_p, LeaveType::LEAVE, ""); });
+ ui_thread_tasks.push([this, room_p]{ delegate->leave_room(room_p, LeaveType::LEAVE, "", true); });
remove_room(room->id);
}
}
@@ -2743,7 +2743,8 @@ namespace QuickMedia {
if(!reason_str.empty())
desc += ", reason: " + reason_str;
- ui_thread_tasks.push([this, room, leave_type, desc{std::move(desc)}]{ delegate->leave_room(room, leave_type, desc); });
+ const bool is_cache = sync_is_cache;
+ ui_thread_tasks.push([this, room, leave_type, desc{std::move(desc)}, is_cache]{ delegate->leave_room(room, leave_type, desc, is_cache); });
remove_room(room_id_str);
break;
}
@@ -3896,7 +3897,7 @@ namespace QuickMedia {
if(download_result == DownloadResult::OK) {
RoomData *room = get_room_by_id(room_id);
if(room) {
- ui_thread_tasks.push([this, room]{ delegate->leave_room(room, LeaveType::LEAVE, ""); });
+ ui_thread_tasks.push([this, room]{ delegate->leave_room(room, LeaveType::LEAVE, "", false); });
remove_room(room_id);
}
}