From 48d0a1ae1f486f079f4416d1ae1ab92ad1b15ced Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 17 Jun 2025 19:30:29 +0200 Subject: Matrix: fix emoji upload --- src/plugins/Matrix.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/plugins/Matrix.cpp') 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); -- cgit v1.2.3-70-g09d2