Fix server switching to https after bootstrap
fixes #878
2 files changed, 5 insertions, 4 deletions
diff --git a/src/LoginPage.cpp b/src/LoginPage.cpp
index cdc2262f..6a83376c 100644
--- a/src/LoginPage.cpp
+++ b/src/LoginPage.cpp
@@ -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);
}
diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp
index f3893998..73e556f7 100644
--- a/src/MainWindow.cpp
+++ b/src/MainWindow.cpp
@@ -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);
|