mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
render emojis on sent whisper
This commit is contained in:
parent
7467e1d0e2
commit
c8f85b7755
1 changed files with 41 additions and 26 deletions
|
@ -12,6 +12,7 @@
|
|||
#include "providers/twitch/TwitchApi.hpp"
|
||||
#include "providers/twitch/TwitchChannel.hpp"
|
||||
#include "providers/twitch/TwitchServer.hpp"
|
||||
#include "singletons/Emotes.hpp"
|
||||
#include "singletons/Paths.hpp"
|
||||
#include "singletons/Settings.hpp"
|
||||
#include "util/CombinePath.hpp"
|
||||
|
@ -163,8 +164,8 @@ QString CommandController::execCommand(const QString &text, ChannelPtr channel,
|
|||
continue;
|
||||
}
|
||||
} // twitch emote
|
||||
|
||||
{ // bttv/ffz emote
|
||||
{
|
||||
if ((emote = bttvemotes.emote({words[i]}))) {
|
||||
flags = MessageElementFlag::BttvEmote;
|
||||
} else if ((emote = ffzemotes.emote({words[i]}))) {
|
||||
|
@ -175,11 +176,26 @@ QString CommandController::execCommand(const QString &text, ChannelPtr channel,
|
|||
continue;
|
||||
}
|
||||
} // bttv/ffz emote
|
||||
{ // text
|
||||
b.emplace<TextElement>(words[i],
|
||||
MessageElementFlag::Text);
|
||||
} // text
|
||||
{ // emoji/text
|
||||
for (auto &variant :
|
||||
app->emotes->emojis.parse(words[i])) {
|
||||
constexpr const static struct {
|
||||
void operator()(EmotePtr emote,
|
||||
MessageBuilder &b) const
|
||||
{
|
||||
b.emplace<EmoteElement>(
|
||||
emote, MessageElementFlag::EmojiAll);
|
||||
}
|
||||
void operator()(const QString &string,
|
||||
MessageBuilder &b) const
|
||||
{
|
||||
b.emplace<TextElement>(
|
||||
string, MessageElementFlag::Text);
|
||||
}
|
||||
} visitor;
|
||||
boost::apply_visitor(
|
||||
[&b](auto &&arg) { visitor(arg, b); }, variant);
|
||||
} // emoji/text
|
||||
}
|
||||
|
||||
b->flags.set(MessageFlag::DoNotTriggerNotification);
|
||||
|
@ -189,8 +205,7 @@ QString CommandController::execCommand(const QString &text, ChannelPtr channel,
|
|||
|
||||
app->twitch.server->sendMessage("jtv", text);
|
||||
|
||||
if (getSettings()->inlineWhispers)
|
||||
{
|
||||
if (getSettings()->inlineWhispers) {
|
||||
app->twitch.server->forEachChannel(
|
||||
[&messagexD](ChannelPtr _channel) {
|
||||
_channel->addMessage(messagexD);
|
||||
|
|
Loading…
Reference in a new issue