aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/third_party_membership.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csapi/third_party_membership.cpp')
-rw-r--r--lib/csapi/third_party_membership.cpp30
1 files changed, 12 insertions, 18 deletions
diff --git a/lib/csapi/third_party_membership.cpp b/lib/csapi/third_party_membership.cpp
index c1683338..3ca986c7 100644
--- a/lib/csapi/third_party_membership.cpp
+++ b/lib/csapi/third_party_membership.cpp
@@ -4,24 +4,18 @@
#include "third_party_membership.h"
-#include "converters.h"
+using namespace Quotient;
-#include <QtCore/QStringBuilder>
-
-using namespace QMatrixClient;
-
-static const auto basePath = QStringLiteral("/_matrix/client/r0");
-
-static const auto InviteBy3PIDJobName = QStringLiteral("InviteBy3PIDJob");
-
-InviteBy3PIDJob::InviteBy3PIDJob(const QString& roomId, const QString& idServer, const QString& medium, const QString& address)
- : BaseJob(HttpVerb::Post, InviteBy3PIDJobName,
- basePath % "/rooms/" % roomId % "/invite")
+InviteBy3PIDJob::InviteBy3PIDJob(const QString& roomId, const QString& idServer,
+ const QString& idAccessToken,
+ const QString& medium, const QString& address)
+ : BaseJob(HttpVerb::Post, QStringLiteral("InviteBy3PIDJob"),
+ makePath("/_matrix/client/v3", "/rooms/", roomId, "/invite"))
{
- QJsonObject _data;
- addParam<>(_data, QStringLiteral("id_server"), idServer);
- addParam<>(_data, QStringLiteral("medium"), medium);
- addParam<>(_data, QStringLiteral("address"), address);
- setRequestData(_data);
+ QJsonObject _dataJson;
+ addParam<>(_dataJson, QStringLiteral("id_server"), idServer);
+ addParam<>(_dataJson, QStringLiteral("id_access_token"), idAccessToken);
+ addParam<>(_dataJson, QStringLiteral("medium"), medium);
+ addParam<>(_dataJson, QStringLiteral("address"), address);
+ setRequestData({ _dataJson });
}
-