diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/Matrix.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp index 5817fe3..c810d88 100644 --- a/src/plugins/Matrix.cpp +++ b/src/plugins/Matrix.cpp @@ -5101,7 +5101,10 @@ namespace QuickMedia { remote_homeserver_url = get_remote_homeserver_url(); char url[512]; - snprintf(url, sizeof(url), "%s/_matrix/media/r0/upload?filename=%s", remote_homeserver_url.c_str(), filename_escaped.c_str()); + snprintf(url, sizeof(url), "%s%s_matrix/media/r0/upload?filename=%s", + remote_homeserver_url.c_str(), + !remote_homeserver_url.empty() && remote_homeserver_url.back() == '/' ? "" : "/", + filename_escaped.c_str()); rapidjson::Document json_root; DownloadResult download_result = download_json(json_root, url, std::move(additional_args), true, &err_msg); |