|
|
@ -134,34 +134,22 @@ void QWebThree::onDataProcessed(QString _json, QString _addInfo) |
|
|
|
if (!_addInfo.compare("internal")) |
|
|
|
return; |
|
|
|
|
|
|
|
if (!_addInfo.compare("eth_changed")) |
|
|
|
if (!_addInfo.compare("shh_changed") || !_addInfo.compare("eth_changed")) |
|
|
|
{ |
|
|
|
QJsonArray resultsArray = QJsonDocument::fromJson(_json.toUtf8()).array(); |
|
|
|
for (int i = 0; i < resultsArray.size(); i++) |
|
|
|
{ |
|
|
|
QJsonObject elem = resultsArray[i].toObject(); |
|
|
|
if (elem.contains("result") && elem["result"].toBool() == true) |
|
|
|
if (elem.contains("result")) |
|
|
|
{ |
|
|
|
QJsonObject res; |
|
|
|
res["_event"] = _addInfo; |
|
|
|
res["_id"] = (int)m_watches[i]; // we can do that couse poll is synchronous
|
|
|
|
response(QString::fromUtf8(QJsonDocument(res).toJson())); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (!_addInfo.compare("shh_changed")) |
|
|
|
{ |
|
|
|
QJsonArray resultsArray = QJsonDocument::fromJson(_json.toUtf8()).array(); |
|
|
|
for (int i = 0; i < resultsArray.size(); i++) |
|
|
|
{ |
|
|
|
QJsonObject elem = resultsArray[i].toObject(); |
|
|
|
if (elem.contains("result")) |
|
|
|
{ |
|
|
|
QJsonObject res; |
|
|
|
res["_event"] = _addInfo; |
|
|
|
res["_id"] = (int)m_shhWatches[i]; |
|
|
|
res["_id"] = (int)m_shhWatches[i]; // we can do that couse poll is synchronous
|
|
|
|
else |
|
|
|
res["_id"] = (int)m_watches[i]; |
|
|
|
|
|
|
|
res["data"] = elem["result"].toArray(); |
|
|
|
response(QString::fromUtf8(QJsonDocument(res).toJson())); |
|
|
|
} |
|
|
|