2022-05-07 17:22:39 +02:00
|
|
|
#include "providers/twitch/pubsubmessages/ChatModeratorAction.hpp"
|
|
|
|
|
2024-03-23 12:22:42 +01:00
|
|
|
#include "util/QMagicEnum.hpp"
|
|
|
|
|
2022-05-07 17:22:39 +02:00
|
|
|
namespace chatterino {
|
|
|
|
|
|
|
|
PubSubChatModeratorActionMessage::PubSubChatModeratorActionMessage(
|
|
|
|
const QJsonObject &root)
|
|
|
|
: typeString(root.value("type").toString())
|
|
|
|
, data(root.value("data").toObject())
|
|
|
|
{
|
2024-03-23 12:22:42 +01:00
|
|
|
auto oType = qmagicenum::enumCast<Type>(this->typeString);
|
2022-05-07 17:22:39 +02:00
|
|
|
if (oType.has_value())
|
|
|
|
{
|
|
|
|
this->type = oType.value();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace chatterino
|