diff options
author | KitsuneRal <Kitsune-Ral@users.sf.net> | 2016-08-23 08:46:30 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-23 08:46:30 +0900 |
commit | ac0336ff600d8b978d3cdb68cd92b3425fe0b100 (patch) | |
tree | 4d48c6f13cfd5494696a3e270421b3ab63124f70 /jobs/postmessagejob.cpp | |
parent | c2e38f28987b4fa273765b4234c6a57bdf75e446 (diff) | |
parent | f6c623a27bcb5ec2fcc83930e500afb597a32a46 (diff) | |
download | libquotient-ac0336ff600d8b978d3cdb68cd92b3425fe0b100.tar.gz libquotient-ac0336ff600d8b978d3cdb68cd92b3425fe0b100.zip |
Merge pull request #15 from Fxrh/kitsune-dropped-kcoreaddons
Upon discussion with @Fxrh in #quaternion, this now comes in master,
Diffstat (limited to 'jobs/postmessagejob.cpp')
-rw-r--r-- | jobs/postmessagejob.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/jobs/postmessagejob.cpp b/jobs/postmessagejob.cpp index cf9b94fd..0a38da62 100644 --- a/jobs/postmessagejob.cpp +++ b/jobs/postmessagejob.cpp @@ -61,14 +61,11 @@ QJsonObject PostMessageJob::data() const return json; } -void PostMessageJob::parseJson(const QJsonDocument& data) +BaseJob::Status PostMessageJob::parseJson(const QJsonDocument& data) { - QJsonObject json = data.object(); - if( !json.contains("event_id") ) - { - fail( BaseJob::UserDefinedError, "Something went wrong..." ); - qDebug() << data; - return; - } - emitResult(); + if( data.object().contains("event_id") ) + return Success; + + qDebug() << data; + return { UserDefinedError, "No event_id in the JSON response" }; } |