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 --- TODO | 4 ++++ src/plugins/Matrix.cpp | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/TODO b/TODO index adee6d5..e56219f 100644 --- a/TODO +++ b/TODO @@ -306,3 +306,7 @@ Re-design matrix /encrypt. You should press G to switch to encryption mode in th will have a padlock in front of it and input text will be orange. Press G again to switch to regular text mode. Also encrypt media and maybe even reactions. + Add /gpg command to send your gpg key. Generate it if it doesn't exist in gpg --list-keys for your matrix id. + Change matrix gpg config to enable option instead. + Allow pressing enter on a message with PGP key to import it. + Cache decrypted gpg messages in ram, so they dont have to be decrypted again when closing the room and entering it again. 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