aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/room_upgrades.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csapi/room_upgrades.cpp')
-rw-r--r--lib/csapi/room_upgrades.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/csapi/room_upgrades.cpp b/lib/csapi/room_upgrades.cpp
index b9f285e8..a72304d1 100644
--- a/lib/csapi/room_upgrades.cpp
+++ b/lib/csapi/room_upgrades.cpp
@@ -14,7 +14,7 @@ static const auto basePath = QStringLiteral("/_matrix/client/r0");
class UpgradeRoomJob::Private
{
- public:
+public:
QString replacementRoom;
};
@@ -22,8 +22,8 @@ static const auto UpgradeRoomJobName = QStringLiteral("UpgradeRoomJob");
UpgradeRoomJob::UpgradeRoomJob(const QString& roomId, const QString& newVersion)
: BaseJob(HttpVerb::Post, UpgradeRoomJobName,
- basePath % "/rooms/" % roomId % "/upgrade"),
- d(new Private)
+ basePath % "/rooms/" % roomId % "/upgrade")
+ , d(new Private)
{
QJsonObject _data;
addParam<>(_data, QStringLiteral("new_version"), newVersion);
@@ -41,8 +41,9 @@ BaseJob::Status UpgradeRoomJob::parseJson(const QJsonDocument& data)
{
auto json = data.object();
if (!json.contains("replacement_room"_ls))
- return { JsonParseError,
+ return { IncorrectResponse,
"The key 'replacement_room' not found in the response" };
fromJson(json.value("replacement_room"_ls), d->replacementRoom);
+
return Success;
}