summary refs log tree commit diff
path: root/src/RegisterPage.h
diff options
context:
space:
mode:
authorCallum Brown <callum@calcuode.com>2021-07-21 11:55:41 +0100
committerCallum Brown <callum@calcuode.com>2021-08-02 20:08:55 +0100
commit041d8fb56c435a3a5f5af9ff304f54deb5883c9b (patch)
treeb015b0b263270970ebae2bcb4f9a6d712d308173 /src/RegisterPage.h
parentMerge pull request #646 from Nheko-Reborn/historical-key-sharing (diff)
downloadnheko-041d8fb56c435a3a5f5af9ff304f54deb5883c9b.tar.xz
Reorganise src/RegisterPage.cpp
Diffstat (limited to 'src/RegisterPage.h')
-rw-r--r--src/RegisterPage.h37
1 files changed, 25 insertions, 12 deletions
diff --git a/src/RegisterPage.h b/src/RegisterPage.h

index 0e4a45d0..44128939 100644 --- a/src/RegisterPage.h +++ b/src/RegisterPage.h
@@ -10,6 +10,7 @@ #include <memory> #include <mtx/user_interactive.hpp> +#include <mtxclient/http/client.hpp> class FlatButton; class RaisedButton; @@ -33,30 +34,40 @@ signals: void errorOccurred(); //! Used to trigger the corresponding slot outside of the main thread. - void versionErrorCb(const QString &err); + void serverError(const QString &err); + + void wellKnownLookup(); + void versionsCheck(); + void registration(); + void UIA(const mtx::user_interactive::Unauthorized &unauthorized); + void registrationWithAuth(const mtx::user_interactive::Auth &auth); void registering(); void registerOk(); - void registerErrorCb(const QString &msg); - void registrationFlow(const std::string &user, - const std::string &pass, - const mtx::user_interactive::Unauthorized &unauthorized); - void registerAuth(const std::string &user, - const std::string &pass, - const mtx::user_interactive::Auth &auth); private slots: void onBackButtonClicked(); void onRegisterButtonClicked(); +private: // function for showing different errors void showError(const QString &msg); + void showError(QLabel *label, const QString &msg); -private: bool checkOneField(QLabel *label, const TextField *t_field, const QString &msg); - bool checkFields(); - void showError(QLabel *label, const QString &msg); - void checkVersionAndRegister(const std::string &username, const std::string &password); + bool checkUsername(); + bool checkPassword(); + bool checkPasswordConfirmation(); + bool checkServer(); + + void doWellKnownLookup(); + void doVersionsCheck(); + void doRegistration(); + void doUIA(const mtx::user_interactive::Unauthorized &unauthorized); + void doRegistrationWithAuth(const mtx::user_interactive::Auth &auth); + mtx::http::Callback<mtx::responses::Register> registrationCb(); + void completeUiaStage(const mtx::user_interactive::Unauthorized &unauthorized); + QVBoxLayout *top_layout_; QHBoxLayout *back_layout_; @@ -69,6 +80,7 @@ private: QLabel *error_password_label_; QLabel *error_password_confirmation_label_; QLabel *error_server_label_; + QLabel *error_registration_token_label_; FlatButton *back_button_; RaisedButton *register_button_; @@ -81,4 +93,5 @@ private: TextField *password_input_; TextField *password_confirmation_; TextField *server_input_; + TextField *registration_token_input_; };