From 8adb2d340de2d4c33e18c7e62e1cc31b89b980ed Mon Sep 17 00:00:00 2001 From: hemirt Date: Fri, 26 Oct 2018 23:45:52 +0200 Subject: [PATCH] parse emojis in whispers --- .../commands/CommandController.cpp | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/controllers/commands/CommandController.cpp b/src/controllers/commands/CommandController.cpp index a5391fbc5..74ed98020 100644 --- a/src/controllers/commands/CommandController.cpp +++ b/src/controllers/commands/CommandController.cpp @@ -177,8 +177,9 @@ QString CommandController::execCommand(const QString &text, ChannelPtr channel, } } // bttv/ffz emote { // emoji/text - for (auto &variant : - app->emotes->emojis.parse(words[i])) { + for (auto &variant : app->emotes->emojis.parse( + app->emotes->emojis.replaceShortCodes( + words[i]))) { constexpr const static struct { void operator()(EmotePtr emote, MessageBuilder &b) const @@ -197,19 +198,20 @@ QString CommandController::execCommand(const QString &text, ChannelPtr channel, [&b](auto &&arg) { visitor(arg, b); }, variant); } // emoji/text } + } - b->flags.set(MessageFlag::DoNotTriggerNotification); - auto messagexD = b.release(); + b->flags.set(MessageFlag::DoNotTriggerNotification); + auto messagexD = b.release(); - app->twitch.server->whispersChannel->addMessage(messagexD); + app->twitch.server->whispersChannel->addMessage(messagexD); - app->twitch.server->sendMessage("jtv", text); + app->twitch.server->sendMessage("jtv", text); - if (getSettings()->inlineWhispers) { - app->twitch.server->forEachChannel( - [&messagexD](ChannelPtr _channel) { - _channel->addMessage(messagexD); - }); + if (getSettings()->inlineWhispers) { + app->twitch.server->forEachChannel( + [&messagexD](ChannelPtr _channel) { + _channel->addMessage(messagexD); + }); } return "";