diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-07-06 20:02:13 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-07-06 20:02:13 +0200 |
commit | 590aa77583414ffd26e523a3cd1b045a401ad82a (patch) | |
tree | da47b1da29f7c61ef3471e1c566ac09c2fd68448 | |
parent | 2d3194c886d6f2e68cee217364cecab2696377d8 (diff) |
Auto-add https to homeserver url
-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 b4d1e7c..8fb8ab9 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -4249,8 +4249,12 @@ namespace QuickMedia { } run_task_with_loading_screen([this, inputs](){ + std::string homeserver = inputs[2]->get_text(); + if(!string_starts_with(homeserver, "http://") && !string_starts_with(homeserver, "https://")) + homeserver = "https://" + homeserver; + std::string err_msg; - if(matrix->login(inputs[0]->get_text(), inputs[1]->get_text(), inputs[2]->get_text(), err_msg) == PluginResult::OK) { + if(matrix->login(inputs[0]->get_text(), inputs[1]->get_text(), homeserver, err_msg) == PluginResult::OK) { current_page = PageType::CHAT; return true; } else { |