diff options
author | Scott Murray <scott.murray@konsulko.com> | 2020-01-02 16:37:36 -0500 |
---|---|---|
committer | Scott Murray <scott.murray@konsulko.com> | 2020-01-03 15:51:17 +0000 |
commit | 68cb7fec30353f3aaffb06c32f172effe6262874 (patch) | |
tree | 4580b2bc32f9c782b5163344fd7aaf3e69303b78 /voice/voice.cpp | |
parent | 95e3f5a2c51062128c68f1150e3e89284ca4dd5b (diff) |
voice: remove workarounds for broken vshl-core event JSON
Now that the broken event argument JSON from the vshl-core binding has
a fix, the workaround of selectively reparsing the voice event arguments
needs to be removed, as it breaks with the corrected events.
Bug-AGL: SPEC-3084
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: Ie158ae326a3dc9c7cf4b08dbdbc729f5587e3758
(cherry picked from commit 77392aeda562e3bbb4f311a99469156cb1a66d75)
Diffstat (limited to 'voice/voice.cpp')
-rw-r--r-- | voice/voice.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/voice/voice.cpp b/voice/voice.cpp index 40349d1..c43e0b5 100644 --- a/voice/voice.cpp +++ b/voice/voice.cpp @@ -55,7 +55,7 @@ void Voice::scan() void Voice::getCBLpair(QString id) { - triggerCBLProcess(id); + triggerCBLProcess(id); } void Voice::subscribeAgentToVshlEvents(QString id) @@ -138,23 +138,15 @@ void Voice::processEvent(VoiceMessage *vmsg) return; } else if (vmsg->isCblEvent()) { - auto payload_iter = data.find("payload"); - if (payload_iter == data.end()) - qWarning() << "no top-level payload field in event"; - auto payload_stringval = payload_iter.value().toString(); - if (!payload_stringval.isEmpty()) - payload_stringval.remove('\n'); - QJsonDocument infodoc = QJsonDocument::fromJson(payload_stringval.toUtf8()); - QJsonObject info = infodoc.object(); - QJsonObject properties = info.value("payload").toObject(); - QString url = properties.value("url").toString(); - QString code = properties.value("code").toString(); + QJsonObject payload = data.value("payload").toObject(); + QString url = payload.value("url").toString(); + QString code = payload.value("code").toString(); if (str.contains("expired")) m_var->updateLoginData(agentId, code, url, true); else if (str.contains("received")) { m_var->updateLoginData(agentId, code, url, false); } else - qWarning() << "unknown cbl event"; + qWarning() << "Unknown cbl event"; return; } @@ -170,8 +162,8 @@ void Voice::processReply(ResponseMessage *rmsg) m_var->setDefaultId( rmsg->replyData().value("default").toString()); } else - qWarning() << "discarding reply received for verb:" << - rmsg->requestVerb(); + qDebug() << "discarding reply received for verb:" << + rmsg->requestVerb(); } void Voice::onConnected() |