Use Quotient's job for password changing

This commit is contained in:
Tobias Fella
2024-12-25 15:53:32 +01:00
parent b595a2966c
commit ef8c89b999
4 changed files with 9 additions and 40 deletions

View File

@@ -1,16 +0,0 @@
// SPDX-FileCopyrightText: 2023 Tobias Fella <tobias.fella@kde.org>
// SPDX-License-Identifier: GPL-2.0-or-later
#include "neochatchangepasswordjob.h"
using namespace Quotient;
NeochatChangePasswordJob::NeochatChangePasswordJob(const QString &newPassword, bool logoutDevices, const std::optional<QJsonObject> &auth)
: BaseJob(HttpVerb::Post, u"ChangePasswordJob"_s, "/_matrix/client/r0/account/password")
{
QJsonObject _data;
addParam<>(_data, u"new_password"_s, newPassword);
addParam<IfNotEmpty>(_data, u"logout_devices"_s, logoutDevices);
addParam<IfNotEmpty>(_data, u"auth"_s, auth);
setRequestData(_data);
}

View File

@@ -1,12 +0,0 @@
// SPDX-FileCopyrightText: 2023 Tobias Fella <tobias.fella@kde.org>
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <Quotient/jobs/basejob.h>
class NeochatChangePasswordJob : public Quotient::BaseJob
{
public:
explicit NeochatChangePasswordJob(const QString &newPassword, bool logoutDevices, const std::optional<QJsonObject> &auth = {});
};