Add support for non-highlight channel point rewards (#1809)

This commit is contained in:
Jonas Schmitt
2020-08-08 15:37:22 +02:00
committed by GitHub
parent 1bd3d10eef
commit 11b8948290
23 changed files with 498 additions and 25 deletions
+16
View File
@@ -27,6 +27,7 @@
#include "singletons/WindowManager.hpp"
#include "util/IsBigEndian.hpp"
#include "util/PostToThread.hpp"
#include "util/RapidjsonHelpers.hpp"
#include "widgets/Notebook.hpp"
#include "widgets/Window.hpp"
#include "widgets/splits/Split.hpp"
@@ -284,6 +285,21 @@ void Application::initPubsub()
chan->deleteMessage(msg->id);
});
this->twitch.pubsub->signals_.pointReward.redeemed.connect([&](auto &data) {
QString channelId;
if (rj::getSafe(data, "channel_id", channelId))
{
const auto &chan =
this->twitch.server->getChannelOrEmptyByID(channelId);
auto channel = dynamic_cast<TwitchChannel *>(chan.get());
channel->addChannelPointReward(ChannelPointReward(data));
}
else
{
qDebug() << "Couldn't find channel id of point reward";
}
});
this->twitch.pubsub->start();
auto RequestModerationActions = [=]() {