Fix server switching to https after bootstrap

fixes #878
This commit is contained in:
Nicolas Werner 2022-03-07 05:26:12 +01:00
parent d59469e52f
commit ac1d678254
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
5 changed files with 9 additions and 7 deletions

View File

@ -405,7 +405,7 @@ if(USE_BUNDLED_MTXCLIENT)
FetchContent_Declare( FetchContent_Declare(
MatrixClient MatrixClient
GIT_REPOSITORY https://github.com/Nheko-Reborn/mtxclient.git GIT_REPOSITORY https://github.com/Nheko-Reborn/mtxclient.git
GIT_TAG e1b75074b501d2d3e0100d1170b3edef8a00799c GIT_TAG a3fec0ae53762a8a482cde50c9709671bcf0548d
) )
set(BUILD_LIB_EXAMPLES OFF CACHE INTERNAL "") set(BUILD_LIB_EXAMPLES OFF CACHE INTERNAL "")
set(BUILD_LIB_TESTS OFF CACHE INTERNAL "") set(BUILD_LIB_TESTS OFF CACHE INTERNAL "")

View File

@ -189,7 +189,7 @@ modules:
buildsystem: cmake-ninja buildsystem: cmake-ninja
name: mtxclient name: mtxclient
sources: sources:
- commit: e1b75074b501d2d3e0100d1170b3edef8a00799c - commit: a3fec0ae53762a8a482cde50c9709671bcf0548d
#tag: v0.6.2 #tag: v0.6.2
type: git type: git
url: https://github.com/Nheko-Reborn/mtxclient.git url: https://github.com/Nheko-Reborn/mtxclient.git

View File

@ -222,7 +222,8 @@ Pane {
} }
function destroyOnClose(obj) { function destroyOnClose(obj) {
obj.closing.connect(() => obj.destroy()); if (obj.closing != undefined) obj.closing.connect(() => obj.destroy());
else if (obj.closed != undefined) obj.closed.connect(() => obj.destroy());
} }
function destroyOnClosed(obj) { function destroyOnClosed(obj) {

View File

@ -163,6 +163,8 @@ LoginPage::checkHomeserverVersion()
return; return;
} }
nhlog::net()->error("Error requesting versions: {}", *err);
emit versionErrorCb( emit versionErrorCb(
tr("An unknown error occured. Make sure the homeserver domain is valid.")); tr("An unknown error occured. Make sure the homeserver domain is valid."));
return; return;
@ -276,7 +278,7 @@ LoginPage::onLoginButtonClicked(LoginMethod loginMethod,
if (res.well_known) { if (res.well_known) {
http::client()->set_server(res.well_known->homeserver.base_url); http::client()->set_server(res.well_known->homeserver.base_url);
nhlog::net()->info("Login requested to user server: " + nhlog::net()->info("Login requested to use server: " +
res.well_known->homeserver.base_url); res.well_known->homeserver.base_url);
} }
@ -301,7 +303,7 @@ LoginPage::onLoginButtonClicked(LoginMethod loginMethod,
if (res.well_known) { if (res.well_known) {
http::client()->set_server(res.well_known->homeserver.base_url); http::client()->set_server(res.well_known->homeserver.base_url);
nhlog::net()->info("Login requested to user server: " + nhlog::net()->info("Login requested to use server: " +
res.well_known->homeserver.base_url); res.well_known->homeserver.base_url);
} }

View File

@ -338,8 +338,7 @@ MainWindow::showChatPage()
{ {
auto userid = QString::fromStdString(http::client()->user_id().to_string()); auto userid = QString::fromStdString(http::client()->user_id().to_string());
auto device_id = QString::fromStdString(http::client()->device_id()); auto device_id = QString::fromStdString(http::client()->device_id());
auto homeserver = QString::fromStdString(http::client()->server() + ":" + auto homeserver = QString::fromStdString(http::client()->server_url());
std::to_string(http::client()->port()));
auto token = QString::fromStdString(http::client()->access_token()); auto token = QString::fromStdString(http::client()->access_token());
userSettings_.data()->setUserId(userid); userSettings_.data()->setUserId(userid);