summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--message.cpp5
-rw-r--r--message.h14
2 files changed, 17 insertions, 2 deletions
diff --git a/message.cpp b/message.cpp
index 014e8e7..95bc586 100644
--- a/message.cpp
+++ b/message.cpp
@@ -103,7 +103,12 @@ bool Message::fromJDoc(QJsonDocument jdoc)
return false;
}
auto status_iter = request.find("status");
+ auto info_iter = request.find("info");
+ auto response_iter = payload.find("response");
+ auto response = response_iter.value().toObject();
m_reply_status = status_iter.value().toString();
+ m_reply_info = info_iter.value().toString();
+ m_reply_data = response;
m_reply = true;
} else if (msgid == Event) {
// If event, save data object
diff --git a/message.h b/message.h
index e9d915a..ff98c43 100644
--- a/message.h
+++ b/message.h
@@ -61,6 +61,16 @@ class Message : public QObject
return m_event_data;
}
+ inline QString replyInfo() const
+ {
+ return m_reply_info;
+ }
+
+ inline QJsonObject replyData() const
+ {
+ return m_reply_data;
+ }
+
inline bool isEvent() const
{
return m_event;
@@ -78,9 +88,9 @@ class Message : public QObject
protected:
bool m_event, m_init, m_reply;
- QString m_event_api, m_event_name, m_reply_status, m_reply_uuid;
+ QString m_event_api, m_event_name, m_reply_info, m_reply_status, m_reply_uuid;
QJsonDocument m_jdoc;
- QJsonObject m_event_data;
+ QJsonObject m_event_data, m_reply_data;
};
#endif // MESSAGE_H