Home: bounties.monero.social

This commit is contained in:
tobtoht
2022-06-23 19:48:30 +02:00
parent 3b3fcfc42c
commit 3c7f1800c2
13 changed files with 405 additions and 4 deletions
+23 -4
View File
@@ -55,6 +55,11 @@ void WebsocketNotifier::onWSMessage(const QJsonObject &msg) {
this->onWSCCS(ccs_data);
}
else if(cmd == "bounties") {
auto data = msg.value("data").toArray();
this->onWSBounties(data);
}
else if(cmd == "txFiatHistory") {
auto txFiatHistory_data = msg.value("data").toObject();
emit TxFiatHistoryReceived(txFiatHistory_data);
@@ -151,10 +156,6 @@ void WebsocketNotifier::onWSReddit(const QJsonArray& reddit_data) {
void WebsocketNotifier::onWSCCS(const QJsonArray &ccs_data) {
QList<QSharedPointer<CCSEntry>> l;
QStringList fonts = {"state", "address", "author", "date",
"title", "target_amount", "raised_amount",
"percentage_funded", "contributions"};
for (auto &&entry: ccs_data) {
auto obj = entry.toObject();
auto c = QSharedPointer<CCSEntry>(new CCSEntry());
@@ -201,6 +202,24 @@ void WebsocketNotifier::onWSRevuo(const QJsonArray &revuo_data) {
emit RevuoReceived(l);
}
void WebsocketNotifier::onWSBounties(const QJsonArray &bounties_data) {
QList<QSharedPointer<BountyEntry>> l;
for (const auto& entry : bounties_data) {
QJsonObject obj = entry.toObject();
auto bounty = new BountyEntry(obj.value("votes").toInt(),
obj.value("title").toString(),
obj.value("amount").toDouble(),
obj.value("link").toString(),
obj.value("address").toString(),
obj.value("status").toString());
QSharedPointer<BountyEntry> b = QSharedPointer<BountyEntry>(bounty);
l.append(b);
}
emit BountyReceived(l);
}
void WebsocketNotifier::onWSUpdates(const QJsonObject &updates) {
emit UpdatesReceived(updates);
}