summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-04-17 00:27:43 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2020-04-17 00:27:43 +0200
commit695c3c0814e74350b1155f84b309ea07accac0b7 (patch)
tree343e4a1eb3e942363c71eaf33c8c6d595c57a1e6
parent70b0cbcd0f51143f741b20023bddb60102fbd800 (diff)
Fix registration on construct
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/RegisterPage.cpp18
2 files changed, 12 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 87a6ebd3..2fab6c93 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -335,7 +335,7 @@ if(USE_BUNDLED_MTXCLIENT)
FetchContent_Declare(
MatrixClient
GIT_REPOSITORY https://github.com/Nheko-Reborn/mtxclient.git
- GIT_TAG 729d9b086d645799dda2a803c64e5b72d5e1959d
+ GIT_TAG 48e100e09b470c5c8be1f13837d4abd990283068
)
FetchContent_MakeAvailable(MatrixClient)
else()
diff --git a/src/RegisterPage.cpp b/src/RegisterPage.cpp
index 39a69a34..2833381d 100644
--- a/src/RegisterPage.cpp
+++ b/src/RegisterPage.cpp
@@ -145,7 +145,8 @@ RegisterPage::RegisterPage(QWidget *parent)
const mtx::user_interactive::Unauthorized &unauthorized) {
auto completed_stages = unauthorized.completed;
auto flows = unauthorized.flows;
- auto session = unauthorized.session;
+ auto session = unauthorized.session.empty() ? http::client()->generate_txn_id()
+ : unauthorized.session;
nhlog::ui()->info("Completed stages: {}", completed_stages.size());
@@ -252,7 +253,7 @@ RegisterPage::RegisterPage(QWidget *parent)
// The server requires registration flows.
if (err->status_code == boost::beast::http::status::unauthorized) {
- if (err->matrix_error.unauthorized.session.empty()) {
+ if (err->matrix_error.unauthorized.flows.empty()) {
nhlog::net()->warn(
"failed to retrieve registration flows: ({}) "
"{}",
@@ -268,8 +269,11 @@ RegisterPage::RegisterPage(QWidget *parent)
return;
}
- nhlog::net()->warn("failed to register: status_code ({})",
- static_cast<int>(err->status_code));
+ nhlog::net()->warn("failed to register: status_code ({}), "
+ "matrix_error: ({}), parser error ({})",
+ static_cast<int>(err->status_code),
+ err->matrix_error.error,
+ err->parse_error);
emit registerErrorCb(QString::fromStdString(err->matrix_error.error));
});
@@ -325,9 +329,9 @@ RegisterPage::onRegisterButtonClicked()
// The server requires registration flows.
if (err->status_code == boost::beast::http::status::unauthorized) {
- if (err->matrix_error.unauthorized.session.empty()) {
+ if (err->matrix_error.unauthorized.flows.empty()) {
nhlog::net()->warn(
- "failed to retrieve registration flows: ({}) "
+ "failed to retrieve registration flows1: ({}) "
"{}",
static_cast<int>(err->status_code),
err->matrix_error.error);
@@ -342,7 +346,7 @@ RegisterPage::onRegisterButtonClicked()
return;
}
- nhlog::net()->warn(
+ nhlog::net()->error(
"failed to register: status_code ({}), matrix_error({})",
static_cast<int>(err->status_code),
err->matrix_error.error);