Add support for non-highlight channel point rewards (#1809)
This commit is contained in:
@@ -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 = [=]() {
|
||||
|
||||
Reference in New Issue
Block a user