diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/QuickMedia.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index 7cbe2c4..9f233da 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -5753,9 +5753,13 @@ namespace QuickMedia { auto upload_file = [this, ¤t_room](const std::string &filepath) { run_task_with_loading_screen([this, ¤t_room, filepath]() { + std::string filepath_mod = filepath; + if(string_starts_with(filepath_mod, "file://")) + filepath_mod.erase(filepath_mod.begin(), filepath_mod.begin() + 7); + std::string event_id_response; std::string err_msg; - if(matrix->post_file(current_room, filepath, event_id_response, err_msg) == PluginResult::OK) { + if(matrix->post_file(current_room, filepath_mod, event_id_response, err_msg) == PluginResult::OK) { return true; } else { show_notification("QuickMedia", "Failed to upload media to room, error: " + err_msg, Urgency::CRITICAL); |