aboutsummaryrefslogtreecommitdiff
path: root/src
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
parent38202de4f953fca28aa884246ced0aadf0d25a4d (diff)
Matrix: do not show kick/ban notification when restarting quickmedia (do not show notification on cache load)
Diffstat (limited to 'src')
-rw-r--r--src/plugins/Matrix.cpp11
-rw-r--r--src/plugins/youtube/YoutubeMediaProxy.cpp1
2 files changed, 7 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);
}
}
diff --git a/src/plugins/youtube/YoutubeMediaProxy.cpp b/src/plugins/youtube/YoutubeMediaProxy.cpp
index e8d0383..cba4a1d 100644
--- a/src/plugins/youtube/YoutubeMediaProxy.cpp
+++ b/src/plugins/youtube/YoutubeMediaProxy.cpp
@@ -447,6 +447,7 @@ namespace QuickMedia {
}
}
+ // TODO: Remove this code and instead create the header ourselves and send it to the client. Then pipe the curl output directly to the client input.
if(!download_header_finished) {
download_header.append(download_read_buffer, downloader_num_read_bytes);
size_t header_end = std::string::npos;