aboutsummaryrefslogtreecommitdiff
path: root/src/QuickMedia.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/QuickMedia.cpp')
-rw-r--r--src/QuickMedia.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index ecb44d5..cb58a27 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -3585,6 +3585,19 @@ namespace QuickMedia {
// TODO: Show inline notification
show_notification("QuickMedia", "No message selected for editing");
}
+ } else if(tabs[selected_tab].type == ChatTabType::MESSAGES && event.key.control && event.key.code == sf::Keyboard::D) {
+ BodyItem *selected = tabs[selected_tab].body->get_selected();
+ if(selected) {
+ // TODO: Make asynchronous
+ std::string err_msg;
+ if(matrix->delete_message(current_room_id, selected->userdata, err_msg) != PluginResult::OK) {
+ // TODO: Show inline notification
+ show_notification("QuickMedia", "Failed to delete message, reason: " + err_msg, Urgency::CRITICAL);
+ }
+ } else {
+ // TODO: Show inline notification
+ show_notification("QuickMedia", "No message selected for deletion");
+ }
}
}