mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-24 20:18:53 +03:00
31 lines
778 B
C++
31 lines
778 B
C++
// 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 = QStringLiteral("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);
|
|
}
|
|
|
|
#include "moc_ReCaptcha.cpp"
|