summary refs log tree commit diff
path: root/src/LoginPage.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-06-30 02:43:36 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-06-30 02:43:36 +0200
commit00f251753e41bd1c65f9e4160fe5b267ce8385ba (patch)
treed1292f8b6b89b511ec920ce272c3092591b438fc /src/LoginPage.cpp
parentFix tags going missing if you join communities (diff)
downloadnheko-00f251753e41bd1c65f9e4160fe5b267ce8385ba.tar.xz
Use coeurl for networking
Something is still wrong on shutdown, need to debug that.
And CI will fail.
Diffstat (limited to 'src/LoginPage.cpp')
-rw-r--r--src/LoginPage.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/LoginPage.cpp b/src/LoginPage.cpp
index c914d66f..f53d81ba 100644
--- a/src/LoginPage.cpp
+++ b/src/LoginPage.cpp
@@ -263,9 +263,7 @@ LoginPage::onMatrixIdEntered()
                 http::client()->well_known([this](const mtx::responses::WellKnown &res,
                                                   mtx::http::RequestErr err) {
                         if (err) {
-                                using namespace boost::beast::http;
-
-                                if (err->status_code == status::not_found) {
+                                if (err->status_code == 404) {
                                         nhlog::net()->info("Autodiscovery: No .well-known.");
                                         checkHomeserverVersion();
                                         return;
@@ -282,8 +280,9 @@ LoginPage::onMatrixIdEntered()
                                 emit versionErrorCb(tr("Autodiscovery failed. Unknown error when "
                                                        "requesting .well-known."));
                                 nhlog::net()->error("Autodiscovery failed. Unknown error when "
-                                                    "requesting .well-known. {}",
-                                                    err->error_code.message());
+                                                    "requesting .well-known. {} {}",
+                                                    err->status_code,
+                                                    err->error_code);
                                 return;
                         }
 
@@ -301,9 +300,7 @@ LoginPage::checkHomeserverVersion()
         http::client()->versions(
           [this](const mtx::responses::Versions &, mtx::http::RequestErr err) {
                   if (err) {
-                          using namespace boost::beast::http;
-
-                          if (err->status_code == status::not_found) {
+                          if (err->status_code == 404) {
                                   emit versionErrorCb(tr("The required endpoints were not found. "
                                                          "Possibly not a Matrix server."));
                                   return;