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(
MatrixClient
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_TESTS OFF CACHE INTERNAL "")

View File

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

View File

@ -222,7 +222,8 @@ Pane {
}
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) {

View File

@ -163,6 +163,8 @@ LoginPage::checkHomeserverVersion()
return;
}
nhlog::net()->error("Error requesting versions: {}", *err);
emit versionErrorCb(
tr("An unknown error occured. Make sure the homeserver domain is valid."));
return;
@ -276,7 +278,7 @@ LoginPage::onLoginButtonClicked(LoginMethod loginMethod,
if (res.well_known) {
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);
}
@ -301,7 +303,7 @@ LoginPage::onLoginButtonClicked(LoginMethod loginMethod,
if (res.well_known) {
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);
}

View File

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