Move TwitchEmoteOccurrence to TwitchCommon.hpp

This commit is contained in:
Rasmus Karlsson 2024-02-25 13:39:49 +01:00
parent b7a3215e90
commit 8ec40f9293
3 changed files with 25 additions and 14 deletions

View file

@ -3,7 +3,7 @@
#include "common/Aliases.hpp"
#include "common/Outcome.hpp"
#include "messages/SharedMessageBuilder.hpp"
#include "providers/twitch/TwitchMessageBuilder.hpp" // TODO: REMOVE
#include "providers/twitch/TwitchCommon.hpp"
#include <QString>
#include <QVariant>
@ -38,6 +38,11 @@ class EventSubMessageBuilder : MessageBuilder
public:
EventSubMessageBuilder() = delete;
EventSubMessageBuilder(const EventSubMessageBuilder &) = delete;
EventSubMessageBuilder &operator=(const EventSubMessageBuilder &) = delete;
EventSubMessageBuilder(EventSubMessageBuilder &&) = delete;
EventSubMessageBuilder &operator=(EventSubMessageBuilder &&) = delete;
/**
* NOTE: The builder MUST NOT survive longer than the payload
**/

View file

@ -1,5 +1,7 @@
#pragma once
#include "common/Aliases.hpp"
#include <QColor>
#include <QString>
@ -7,6 +9,9 @@
namespace chatterino {
struct Emote;
using EmotePtr = std::shared_ptr<const Emote>;
#ifndef ATTR_UNUSED
# ifdef Q_OS_WIN
# define ATTR_UNUSED
@ -81,4 +86,17 @@ static const QStringList TWITCH_DEFAULT_COMMANDS{
static const QStringList TWITCH_WHISPER_COMMANDS{"/w", ".w"};
struct TwitchEmoteOccurrence {
int start;
int end;
EmotePtr ptr;
EmoteName name;
bool operator==(const TwitchEmoteOccurrence &other) const
{
return std::tie(this->start, this->end, this->ptr, this->name) ==
std::tie(other.start, other.end, other.ptr, other.name);
}
};
} // namespace chatterino

View file

@ -3,6 +3,7 @@
#include "common/Aliases.hpp"
#include "common/Outcome.hpp"
#include "messages/SharedMessageBuilder.hpp"
#include "providers/twitch/TwitchCommon.hpp"
#include "pubsubmessages/LowTrustUsers.hpp"
#include <IrcMessage>
@ -26,19 +27,6 @@ using HelixModerator = HelixVip;
struct ChannelPointReward;
struct DeleteAction;
struct TwitchEmoteOccurrence {
int start;
int end;
EmotePtr ptr;
EmoteName name;
bool operator==(const TwitchEmoteOccurrence &other) const
{
return std::tie(this->start, this->end, this->ptr, this->name) ==
std::tie(other.start, other.end, other.ptr, other.name);
}
};
class TwitchMessageBuilder : public SharedMessageBuilder
{
public: