diff options
author | Raquel Medina <raquel.medina@konsulko.com> | 2019-12-13 22:34:58 +0100 |
---|---|---|
committer | Raquel Medina <raquel.medina@konsulko.com> | 2019-12-13 22:49:37 +0100 |
commit | 21bba7d5db82a5261ec3a5db1971985b70d49b07 (patch) | |
tree | 1fbab2d1609bddad25212cc0a8f57b7908110183 /message.cpp | |
parent | 9f3896cb82c27e912bc37ae88254367911050512 (diff) |
fix parsing event payload in presence of '\n' chars,icefish_8.99.3icefish/8.99.38.99.3
and include signal emit for voice status and cbl
changes.
- fix parsing event payload in presence of whitespaces;
- fix parsing voice events payload in presence of
'\n' chars;
- add missing model updates when status or cbl data
changes;
- fix authorization status enum value typo;
Bug-AGL: SPEC-2981
Signed-off-by: Raquel Medina <raquel.medina@konsulko.com>
Change-Id: I718bdfea1221211ed4c62ce1b695eabe83ab9590
Diffstat (limited to 'message.cpp')
-rw-r--r-- | message.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/message.cpp b/message.cpp index 3cd4bb9..e4cd191 100644 --- a/message.cpp +++ b/message.cpp @@ -114,7 +114,13 @@ bool Message::fromJDoc(QJsonDocument jdoc) } else if (msgid == Event) { // If event, save data object auto data_iter = payload.find("data"); - m_event_data = data_iter.value().toObject(); + auto data = data_iter.value().toObject(); + auto data_string = data_iter.value().toString(); + if (!data_string.isEmpty()) + data_string.remove('\n'); + + QJsonDocument datadoc = QJsonDocument::fromJson(data_string.toUtf8()); + m_event_data = datadoc.object(); auto event_iter = payload.find("event"); auto event_string = event_iter.value().toString(); |