diff --git a/src/Application.hpp b/src/Application.hpp index ec0b77ce..83a8b90e 100644 --- a/src/Application.hpp +++ b/src/Application.hpp @@ -128,11 +128,7 @@ public: private: Theme *const themes{}; Fonts *const fonts{}; - -public: Emotes *const emotes{}; - -private: AccountController *const accounts{}; HotkeyController *const hotkeys{}; WindowManager *const windows{}; diff --git a/src/controllers/commands/CommandController.cpp b/src/controllers/commands/CommandController.cpp index b50fb5fc..dd9025fb 100644 --- a/src/controllers/commands/CommandController.cpp +++ b/src/controllers/commands/CommandController.cpp @@ -476,7 +476,8 @@ CommandModel *CommandController::createModel(QObject *parent) QString CommandController::execCommand(const QString &textNoEmoji, ChannelPtr channel, bool dryRun) { - QString text = getApp()->emotes->emojis.replaceShortCodes(textNoEmoji); + QString text = + getIApp()->getEmotes()->getEmojis()->replaceShortCodes(textNoEmoji); QStringList words = text.split(' ', Qt::SkipEmptyParts); if (words.length() == 0) @@ -491,7 +492,7 @@ QString CommandController::execCommand(const QString &textNoEmoji, const auto it = this->userCommands_.find(commandName); if (it != this->userCommands_.end()) { - text = getApp()->emotes->emojis.replaceShortCodes( + text = getIApp()->getEmotes()->getEmojis()->replaceShortCodes( this->execCustomCommand(words, it.value(), dryRun, channel)); words = text.split(' ', Qt::SkipEmptyParts); diff --git a/src/controllers/commands/builtin/twitch/SendWhisper.cpp b/src/controllers/commands/builtin/twitch/SendWhisper.cpp index dde768f9..bcccdc92 100644 --- a/src/controllers/commands/builtin/twitch/SendWhisper.cpp +++ b/src/controllers/commands/builtin/twitch/SendWhisper.cpp @@ -137,7 +137,7 @@ bool appendWhisperMessageWordsLocally(const QStringList &words) } } // bttv/ffz emote { // emoji/text - for (auto &variant : app->emotes->emojis.parse(words[i])) + for (auto &variant : app->getEmotes()->getEmojis()->parse(words[i])) { constexpr const static struct { void operator()(EmotePtr emote, MessageBuilder &b) const diff --git a/src/messages/Image.cpp b/src/messages/Image.cpp index 59e5d936..d3367047 100644 --- a/src/messages/Image.cpp +++ b/src/messages/Image.cpp @@ -53,7 +53,7 @@ namespace detail { DebugCount::increase("animated images"); this->gifTimerConnection_ = - getApp()->emotes->gifTimer.signal.connect([this] { + getIApp()->getEmotes()->getGIFTimer().signal.connect([this] { this->advance(); }); } diff --git a/src/messages/MessageBuilder.cpp b/src/messages/MessageBuilder.cpp index 52428d1d..d1465cef 100644 --- a/src/messages/MessageBuilder.cpp +++ b/src/messages/MessageBuilder.cpp @@ -814,7 +814,7 @@ void MessageBuilder::addIrcWord(const QString &text, const QColor &color, bool addSpace) { this->textColor_ = color; - for (auto &variant : getApp()->emotes->emojis.parse(text)) + for (auto &variant : getIApp()->getEmotes()->getEmojis()->parse(text)) { boost::apply_visitor( [&](auto &&arg) { diff --git a/src/messages/MessageElement.cpp b/src/messages/MessageElement.cpp index a2e6b00a..28027ba6 100644 --- a/src/messages/MessageElement.cpp +++ b/src/messages/MessageElement.cpp @@ -685,7 +685,8 @@ void SingleLineTextElement::addToContainer(MessageLayoutContainer &container, currentText += ' '; } - for (const auto &parsedWord : app->emotes->emojis.parse(word.text)) + for (const auto &parsedWord : + app->getEmotes()->getEmojis()->parse(word.text)) { if (parsedWord.type() == typeid(QString)) { diff --git a/src/providers/twitch/TwitchAccount.cpp b/src/providers/twitch/TwitchAccount.cpp index acf56225..8b531156 100644 --- a/src/providers/twitch/TwitchAccount.cpp +++ b/src/providers/twitch/TwitchAccount.cpp @@ -325,8 +325,10 @@ void TwitchAccount::loadUserstateEmotes(std::weak_ptr weakChannel) emoteSet->emotes.push_back(TwitchEmote{id, code}); - auto emote = - getApp()->emotes->twitch.getOrCreateEmote(id, code); + auto emote = getIApp() + ->getEmotes() + ->getTwitchEmotes() + ->getOrCreateEmote(id, code); // Follower emotes can be only used in their origin channel // unless the user is subscribed, then they can be used anywhere. diff --git a/src/providers/twitch/TwitchChannel.cpp b/src/providers/twitch/TwitchChannel.cpp index 659c4882..518e21b6 100644 --- a/src/providers/twitch/TwitchChannel.cpp +++ b/src/providers/twitch/TwitchChannel.cpp @@ -576,7 +576,8 @@ void TwitchChannel::roomIdChanged() QString TwitchChannel::prepareMessage(const QString &message) const { auto *app = getApp(); - QString parsedMessage = app->emotes->emojis.replaceShortCodes(message); + QString parsedMessage = + app->getEmotes()->getEmojis()->replaceShortCodes(message); parsedMessage = parsedMessage.simplified(); diff --git a/src/widgets/dialogs/EmotePopup.cpp b/src/widgets/dialogs/EmotePopup.cpp index 825d8e0f..e83536e2 100644 --- a/src/widgets/dialogs/EmotePopup.cpp +++ b/src/widgets/dialogs/EmotePopup.cpp @@ -127,8 +127,8 @@ void addTwitchEmoteSets( { builder .emplace( - getApp()->emotes->twitch.getOrCreateEmote(emote.id, - emote.name), + getIApp()->getEmotes()->getTwitchEmotes()->getOrCreateEmote( + emote.id, emote.name), MessageElementFlags{MessageElementFlag::AlwaysShow, MessageElementFlag::TwitchEmote}) ->setLink(Link(Link::InsertText, emote.name.string));