2022-05-07 17:22:39 +02:00
|
|
|
#pragma once
|
|
|
|
|
2023-12-01 15:03:04 +01:00
|
|
|
#include <magic_enum/magic_enum.hpp>
|
2022-05-07 17:22:39 +02:00
|
|
|
#include <QJsonObject>
|
|
|
|
#include <QString>
|
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
|
|
|
|
struct PubSubChatModeratorActionMessage {
|
|
|
|
enum class Type {
|
|
|
|
ModerationAction,
|
|
|
|
ChannelTermsAction,
|
|
|
|
|
|
|
|
INVALID,
|
|
|
|
};
|
|
|
|
|
|
|
|
QString typeString;
|
|
|
|
Type type = Type::INVALID;
|
|
|
|
|
|
|
|
QJsonObject data;
|
|
|
|
|
|
|
|
PubSubChatModeratorActionMessage(const QJsonObject &root);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace chatterino
|
|
|
|
|
|
|
|
template <>
|
|
|
|
constexpr magic_enum::customize::customize_t magic_enum::customize::enum_name<
|
|
|
|
chatterino::PubSubChatModeratorActionMessage::Type>(
|
|
|
|
chatterino::PubSubChatModeratorActionMessage::Type value) noexcept
|
|
|
|
{
|
|
|
|
switch (value)
|
|
|
|
{
|
|
|
|
case chatterino::PubSubChatModeratorActionMessage::Type::
|
|
|
|
ModerationAction:
|
|
|
|
return "moderation_action";
|
|
|
|
|
|
|
|
case chatterino::PubSubChatModeratorActionMessage::Type::
|
|
|
|
ChannelTermsAction:
|
|
|
|
return "channel_terms_action";
|
|
|
|
|
|
|
|
default:
|
|
|
|
return default_tag;
|
|
|
|
}
|
|
|
|
}
|