Port the reCAPTCHA dialog to QML
This commit is contained in:
parent
ff4c16c34f
commit
fedc178827
9 changed files with 153 additions and 124 deletions
28
src/ReCaptcha.cpp
Normal file
28
src/ReCaptcha.cpp
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
// SPDX-FileCopyrightText: Nheko Contributors
|
||||
//
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "ReCaptcha.h"
|
||||
|
||||
#include <QDesktopServices>
|
||||
#include <QUrl>
|
||||
|
||||
#include "MatrixClient.h"
|
||||
|
||||
ReCaptcha::ReCaptcha(const QString &session, const QString &context, QObject *parent)
|
||||
: QObject{parent},
|
||||
m_session{session},
|
||||
m_context{context}
|
||||
{
|
||||
}
|
||||
|
||||
void ReCaptcha::openReCaptcha()
|
||||
{
|
||||
const auto url = QString("https://%1:%2/_matrix/client/r0/auth/m.login.recaptcha/"
|
||||
"fallback/web?session=%3")
|
||||
.arg(QString::fromStdString(http::client()->server()))
|
||||
.arg(http::client()->port())
|
||||
.arg(m_session);
|
||||
|
||||
QDesktopServices::openUrl(url);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue