diff options
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" }; } |