From b89257a34b2a98b737f4ae544f7e436b9000b240 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Sat, 9 Jun 2018 16:03:14 +0300 Subject: Migrate to mtxclient for the http calls --- src/dialogs/ReCaptcha.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/dialogs/ReCaptcha.cpp') diff --git a/src/dialogs/ReCaptcha.cpp b/src/dialogs/ReCaptcha.cpp index ba487cea..6b1143b5 100644 --- a/src/dialogs/ReCaptcha.cpp +++ b/src/dialogs/ReCaptcha.cpp @@ -6,6 +6,7 @@ #include "Config.h" #include "FlatButton.h" +#include "MatrixClient.h" #include "RaisedButton.h" #include "Theme.h" @@ -13,7 +14,7 @@ using namespace dialogs; -ReCaptcha::ReCaptcha(const QString &server, const QString &session, QWidget *parent) +ReCaptcha::ReCaptcha(const QString &session, QWidget *parent) : QWidget(parent) { setAutoFillBackground(true); @@ -51,12 +52,12 @@ ReCaptcha::ReCaptcha(const QString &server, const QString &session, QWidget *par layout->addWidget(label); layout->addLayout(buttonLayout); - connect(openCaptchaBtn_, &QPushButton::clicked, [server, session]() { - const auto url = - QString( - "https://%1/_matrix/client/r0/auth/m.login.recaptcha/fallback/web?session=%2") - .arg(server) - .arg(session); + connect(openCaptchaBtn_, &QPushButton::clicked, [session]() { + const auto url = QString("https://%1:%2/_matrix/client/r0/auth/m.login.recaptcha/" + "fallback/web?session=%3") + .arg(QString::fromStdString(http::v2::client()->server())) + .arg(http::v2::client()->port()) + .arg(session); QDesktopServices::openUrl(url); }); -- cgit 1.5.1