diff options
Diffstat (limited to 'jobs/joinroomjob.cpp')
-rw-r--r-- | jobs/joinroomjob.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/jobs/joinroomjob.cpp b/jobs/joinroomjob.cpp index 799d4926..8848aa70 100644 --- a/jobs/joinroomjob.cpp +++ b/jobs/joinroomjob.cpp @@ -54,18 +54,15 @@ QString JoinRoomJob::apiPath() const return QString("_matrix/client/r0/join/%1").arg(d->roomAlias); } -void JoinRoomJob::parseJson(const QJsonDocument& data) +BaseJob::Status JoinRoomJob::parseJson(const QJsonDocument& data) { QJsonObject json = data.object(); - if( !json.contains("room_id") ) - { - fail( BaseJob::UserDefinedError, "Something went wrong..." ); - qDebug() << data; - return; - } - else + if( json.contains("room_id") ) { d->roomId = json.value("room_id").toString(); + return Success; } - emitResult(); + + qDebug() << data; + return { UserDefinedError, "No room_id in the JSON response" }; } |