File indexing completed on 2024-05-12 05:01:25

0001 // SPDX-FileCopyrightText: 2023 Tobias Fella <tobias.fella@kde.org>
0002 // SPDX-License-Identifier: GPL-2.0-or-later
0003 
0004 #include "neochatchangepasswordjob.h"
0005 
0006 using namespace Quotient;
0007 
0008 NeochatChangePasswordJob::NeochatChangePasswordJob(const QString &newPassword, bool logoutDevices, const Omittable<QJsonObject> &auth)
0009     : BaseJob(HttpVerb::Post, QStringLiteral("ChangePasswordJob"), "/_matrix/client/r0/account/password")
0010 {
0011     QJsonObject _data;
0012     addParam<>(_data, QStringLiteral("new_password"), newPassword);
0013     addParam<IfNotEmpty>(_data, QStringLiteral("logout_devices"), logoutDevices);
0014     addParam<IfNotEmpty>(_data, QStringLiteral("auth"), auth);
0015     setRequestData(_data);
0016 }