mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Added setting to display them inline under "Special Channels" page Store a twitch users color in the TwitchUser struct this is useful if we ever want to use the users own color. The users own color is only updated once he has written once in chat Add helper method for calling function only on normal channels Fixes #54
71 lines
1.9 KiB
C++
71 lines
1.9 KiB
C++
#pragma once
|
|
|
|
#include "messages/messagebuilder.hpp"
|
|
#include "messages/messageparseargs.hpp"
|
|
#include "singletons/emotemanager.hpp"
|
|
|
|
#include <IrcMessage>
|
|
|
|
#include <QString>
|
|
#include <QVariant>
|
|
|
|
namespace chatterino {
|
|
class Channel;
|
|
|
|
namespace twitch {
|
|
class TwitchChannel;
|
|
|
|
class TwitchMessageBuilder : public messages::MessageBuilder
|
|
{
|
|
public:
|
|
enum UsernameDisplayMode : int {
|
|
Username = 1, // Username
|
|
LocalizedName = 2, // Localized name
|
|
UsernameAndLocalizedName = 3, // Username (Localized name)
|
|
};
|
|
|
|
TwitchMessageBuilder() = delete;
|
|
|
|
explicit TwitchMessageBuilder(Channel *_channel, const Communi::IrcPrivateMessage *_ircMessage,
|
|
const messages::MessageParseArgs &_args);
|
|
explicit TwitchMessageBuilder(Channel *_channel, const Communi::IrcMessage *_ircMessage,
|
|
QString content, const messages::MessageParseArgs &_args);
|
|
|
|
Channel *channel;
|
|
TwitchChannel *twitchChannel;
|
|
const Communi::IrcMessage *ircMessage;
|
|
messages::MessageParseArgs args;
|
|
const QVariantMap tags;
|
|
|
|
QString messageID;
|
|
QString userName;
|
|
|
|
bool isIgnored() const;
|
|
messages::MessagePtr build();
|
|
|
|
private:
|
|
QString roomID;
|
|
|
|
QColor usernameColor;
|
|
const QString originalMessage;
|
|
|
|
const bool action = false;
|
|
|
|
void parseMessageID();
|
|
void parseRoomID();
|
|
void appendChannelName();
|
|
void parseUsername();
|
|
void appendUsername();
|
|
void parseHighlights();
|
|
|
|
void appendTwitchEmote(const Communi::IrcMessage *ircMessage, const QString &emote,
|
|
std::vector<std::pair<long, util::EmoteData>> &vec);
|
|
bool tryAppendEmote(QString &emoteString);
|
|
|
|
void appendTwitchBadges();
|
|
void appendChatterinoBadges();
|
|
bool tryParseCheermote(const QString &string);
|
|
};
|
|
|
|
} // namespace twitch
|
|
} // namespace chatterino
|