diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2019-08-03 17:29:52 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-03 17:29:52 +0900 |
commit | 66e116b7b1e848e80577a0229c8995db0a54932e (patch) | |
tree | 763340439a0f4034e9c829d76cb1ffe9766b83c5 /lib/csapi/room_state.cpp | |
parent | 5b236dfe895c7766002559570aa29c9033009228 (diff) | |
parent | c05ade838f0fce81f2bbe80a3295618a8a26ff52 (diff) | |
download | libquotient-66e116b7b1e848e80577a0229c8995db0a54932e.tar.gz libquotient-66e116b7b1e848e80577a0229c8995db0a54932e.zip |
Merge pull request #295 from marcdeop/140_impose_coding_standard
140 impose coding standard
Diffstat (limited to 'lib/csapi/room_state.cpp')
-rw-r--r-- | lib/csapi/room_state.cpp | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/lib/csapi/room_state.cpp b/lib/csapi/room_state.cpp index 3aa7d736..ef4afcd0 100644 --- a/lib/csapi/room_state.cpp +++ b/lib/csapi/room_state.cpp @@ -14,15 +14,20 @@ static const auto basePath = QStringLiteral("/_matrix/client/r0"); class SetRoomStateWithKeyJob::Private { - public: - QString eventId; +public: + QString eventId; }; -static const auto SetRoomStateWithKeyJobName = QStringLiteral("SetRoomStateWithKeyJob"); +static const auto SetRoomStateWithKeyJobName = + QStringLiteral("SetRoomStateWithKeyJob"); -SetRoomStateWithKeyJob::SetRoomStateWithKeyJob(const QString& roomId, const QString& eventType, const QString& stateKey, const QJsonObject& body) +SetRoomStateWithKeyJob::SetRoomStateWithKeyJob(const QString& roomId, + const QString& eventType, + const QString& stateKey, + const QJsonObject& body) : BaseJob(HttpVerb::Put, SetRoomStateWithKeyJobName, - basePath % "/rooms/" % roomId % "/state/" % eventType % "/" % stateKey) + basePath % "/rooms/" % roomId % "/state/" % eventType % "/" + % stateKey) , d(new Private) { setRequestData(Data(toJson(body))); @@ -30,29 +35,28 @@ SetRoomStateWithKeyJob::SetRoomStateWithKeyJob(const QString& roomId, const QStr SetRoomStateWithKeyJob::~SetRoomStateWithKeyJob() = default; -const QString& SetRoomStateWithKeyJob::eventId() const -{ - return d->eventId; -} +const QString& SetRoomStateWithKeyJob::eventId() const { return d->eventId; } BaseJob::Status SetRoomStateWithKeyJob::parseJson(const QJsonDocument& data) { auto json = data.object(); fromJson(json.value("event_id"_ls), d->eventId); + return Success; } class SetRoomStateJob::Private { - public: - QString eventId; +public: + QString eventId; }; static const auto SetRoomStateJobName = QStringLiteral("SetRoomStateJob"); -SetRoomStateJob::SetRoomStateJob(const QString& roomId, const QString& eventType, const QJsonObject& body) +SetRoomStateJob::SetRoomStateJob(const QString& roomId, const QString& eventType, + const QJsonObject& body) : BaseJob(HttpVerb::Put, SetRoomStateJobName, - basePath % "/rooms/" % roomId % "/state/" % eventType) + basePath % "/rooms/" % roomId % "/state/" % eventType) , d(new Private) { setRequestData(Data(toJson(body))); @@ -60,15 +64,12 @@ SetRoomStateJob::SetRoomStateJob(const QString& roomId, const QString& eventType SetRoomStateJob::~SetRoomStateJob() = default; -const QString& SetRoomStateJob::eventId() const -{ - return d->eventId; -} +const QString& SetRoomStateJob::eventId() const { return d->eventId; } BaseJob::Status SetRoomStateJob::parseJson(const QJsonDocument& data) { auto json = data.object(); fromJson(json.value("event_id"_ls), d->eventId); + return Success; } - |