diff options
Diffstat (limited to 'lib/csapi/directory.cpp')
-rw-r--r-- | lib/csapi/directory.cpp | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/lib/csapi/directory.cpp b/lib/csapi/directory.cpp index 4af86f7b..b4282ffb 100644 --- a/lib/csapi/directory.cpp +++ b/lib/csapi/directory.cpp @@ -14,9 +14,10 @@ static const auto basePath = QStringLiteral("/_matrix/client/r0/directory"); static const auto SetRoomAliasJobName = QStringLiteral("SetRoomAliasJob"); -SetRoomAliasJob::SetRoomAliasJob(const QString& roomAlias, const QString& roomId) +SetRoomAliasJob::SetRoomAliasJob(const QString& roomAlias, + const QString& roomId) : BaseJob(HttpVerb::Put, SetRoomAliasJobName, - basePath % "/room/" % roomAlias) + basePath % "/room/" % roomAlias) { QJsonObject _data; addParam<>(_data, QStringLiteral("room_id"), roomId); @@ -26,36 +27,31 @@ SetRoomAliasJob::SetRoomAliasJob(const QString& roomAlias, const QString& roomId class GetRoomIdByAliasJob::Private { public: - QString roomId; - QStringList servers; + QString roomId; + QStringList servers; }; QUrl GetRoomIdByAliasJob::makeRequestUrl(QUrl baseUrl, const QString& roomAlias) { return BaseJob::makeRequestUrl(std::move(baseUrl), - basePath % "/room/" % roomAlias); + basePath % "/room/" % roomAlias); } -static const auto GetRoomIdByAliasJobName = QStringLiteral("GetRoomIdByAliasJob"); +static const auto GetRoomIdByAliasJobName = + QStringLiteral("GetRoomIdByAliasJob"); GetRoomIdByAliasJob::GetRoomIdByAliasJob(const QString& roomAlias) : BaseJob(HttpVerb::Get, GetRoomIdByAliasJobName, - basePath % "/room/" % roomAlias, false) - , d(new Private) + basePath % "/room/" % roomAlias, false), + d(new Private) { } GetRoomIdByAliasJob::~GetRoomIdByAliasJob() = default; -const QString& GetRoomIdByAliasJob::roomId() const -{ - return d->roomId; -} +const QString& GetRoomIdByAliasJob::roomId() const { return d->roomId; } -const QStringList& GetRoomIdByAliasJob::servers() const -{ - return d->servers; -} +const QStringList& GetRoomIdByAliasJob::servers() const { return d->servers; } BaseJob::Status GetRoomIdByAliasJob::parseJson(const QJsonDocument& data) { @@ -68,14 +64,13 @@ BaseJob::Status GetRoomIdByAliasJob::parseJson(const QJsonDocument& data) QUrl DeleteRoomAliasJob::makeRequestUrl(QUrl baseUrl, const QString& roomAlias) { return BaseJob::makeRequestUrl(std::move(baseUrl), - basePath % "/room/" % roomAlias); + basePath % "/room/" % roomAlias); } static const auto DeleteRoomAliasJobName = QStringLiteral("DeleteRoomAliasJob"); DeleteRoomAliasJob::DeleteRoomAliasJob(const QString& roomAlias) : BaseJob(HttpVerb::Delete, DeleteRoomAliasJobName, - basePath % "/room/" % roomAlias) + basePath % "/room/" % roomAlias) { } - |