feat: add initial experimental Twitch Eventsub support (#5837)
Co-authored-by: nerix <nerixdev@outlook.de>
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
#include "providers/twitch/eventsub/SubscriptionRequest.hpp"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
namespace chatterino::eventsub {
|
||||
|
||||
QDebug &operator<<(QDebug &dbg, const SubscriptionRequest &v)
|
||||
{
|
||||
dbg << "eventsub::SubscriptionRequest{ type:" << v.subscriptionType
|
||||
<< "version:" << v.subscriptionVersion;
|
||||
if (!v.conditions.empty())
|
||||
{
|
||||
dbg << "conditions:[";
|
||||
for (const auto &[conditionKey, conditionValue] : v.conditions)
|
||||
{
|
||||
dbg << conditionKey << "=" << conditionValue << ',';
|
||||
}
|
||||
dbg << ']';
|
||||
}
|
||||
dbg << '}';
|
||||
return dbg;
|
||||
}
|
||||
|
||||
bool operator==(const SubscriptionRequest &lhs, const SubscriptionRequest &rhs)
|
||||
{
|
||||
return std::tie(lhs.subscriptionType, lhs.subscriptionVersion,
|
||||
lhs.conditions) == std::tie(rhs.subscriptionType,
|
||||
rhs.subscriptionVersion,
|
||||
rhs.conditions);
|
||||
}
|
||||
|
||||
bool operator!=(const SubscriptionRequest &lhs, const SubscriptionRequest &rhs)
|
||||
{
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
|
||||
} // namespace chatterino::eventsub
|
||||
Reference in New Issue
Block a user