mirror of
https://github.com/wownero/wowlet.git
synced 2026-12-04 05:54:01 +01:00
Home: Revuo Monero
This commit is contained in:
@@ -60,6 +60,11 @@ void WebsocketNotifier::onWSMessage(const QJsonObject &msg) {
|
||||
emit TxFiatHistoryReceived(txFiatHistory_data);
|
||||
}
|
||||
|
||||
else if(cmd == "revuo") {
|
||||
auto revuo_data = msg.value("data").toArray();
|
||||
this->onWSRevuo(revuo_data);
|
||||
}
|
||||
|
||||
#if defined(CHECK_UPDATES)
|
||||
else if (cmd == "updates") {
|
||||
this->onWSUpdates(msg.value("data").toObject());
|
||||
@@ -176,6 +181,29 @@ void WebsocketNotifier::onWSCCS(const QJsonArray &ccs_data) {
|
||||
emit CCSReceived(l);
|
||||
}
|
||||
|
||||
void WebsocketNotifier::onWSRevuo(const QJsonArray &revuo_data) {
|
||||
QList<QSharedPointer<RevuoItem>> l;
|
||||
|
||||
for (auto &&entry: revuo_data) {
|
||||
auto obj = entry.toObject();
|
||||
|
||||
QStringList newsbytes;
|
||||
for (const auto &n : obj.value("newsbytes").toArray()) {
|
||||
newsbytes.append(n.toString());
|
||||
}
|
||||
|
||||
auto revuoItem = new RevuoItem(
|
||||
obj.value("title").toString(),
|
||||
obj.value("url").toString(),
|
||||
newsbytes);
|
||||
|
||||
QSharedPointer<RevuoItem> r = QSharedPointer<RevuoItem>(revuoItem);
|
||||
l.append(r);
|
||||
}
|
||||
|
||||
emit RevuoReceived(l);
|
||||
}
|
||||
|
||||
void WebsocketNotifier::onWSUpdates(const QJsonObject &updates) {
|
||||
emit UpdatesReceived(updates);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "prices.h"
|
||||
#include "widgets/RedditPost.h"
|
||||
#include "widgets/CCSEntry.h"
|
||||
#include "widgets/RevuoItem.h"
|
||||
#include "TxFiatHistory.h"
|
||||
|
||||
class WebsocketNotifier : public QObject {
|
||||
@@ -36,6 +37,7 @@ signals:
|
||||
void FiatRatesReceived(const QJsonObject &fiat_rates);
|
||||
void RedditReceived(QList<QSharedPointer<RedditPost>> L);
|
||||
void CCSReceived(QList<QSharedPointer<CCSEntry>> L);
|
||||
void RevuoReceived(QList<QSharedPointer<RevuoItem>> L);
|
||||
void TxFiatHistoryReceived(const QJsonObject &data);
|
||||
void UpdatesReceived(const QJsonObject &updates);
|
||||
void XMRigDownloadsReceived(const QJsonObject &downloads);
|
||||
@@ -49,6 +51,7 @@ private slots:
|
||||
void onWSNodes(const QJsonArray &nodes);
|
||||
void onWSReddit(const QJsonArray &reddit_data);
|
||||
void onWSCCS(const QJsonArray &ccs_data);
|
||||
void onWSRevuo(const QJsonArray &revuo_data);
|
||||
void onWSUpdates(const QJsonObject &updates);
|
||||
void onWSXMRigDownloads(const QJsonObject &downloads);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user