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/TwitchApi.hpp"
|
||||||
#include "providers/twitch/TwitchChannel.hpp"
|
#include "providers/twitch/TwitchChannel.hpp"
|
||||||
#include "providers/twitch/TwitchServer.hpp"
|
#include "providers/twitch/TwitchServer.hpp"
|
||||||
|
#include "singletons/Emotes.hpp"
|
||||||
#include "singletons/Paths.hpp"
|
#include "singletons/Paths.hpp"
|
||||||
#include "singletons/Settings.hpp"
|
#include "singletons/Settings.hpp"
|
||||||
#include "util/CombinePath.hpp"
|
#include "util/CombinePath.hpp"
|
||||||
|
@ -163,8 +164,8 @@ QString CommandController::execCommand(const QString &text, ChannelPtr channel,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} // twitch emote
|
} // twitch emote
|
||||||
|
|
||||||
{ // bttv/ffz emote
|
{ // bttv/ffz emote
|
||||||
{
|
|
||||||
if ((emote = bttvemotes.emote({words[i]}))) {
|
if ((emote = bttvemotes.emote({words[i]}))) {
|
||||||
flags = MessageElementFlag::BttvEmote;
|
flags = MessageElementFlag::BttvEmote;
|
||||||
} else if ((emote = ffzemotes.emote({words[i]}))) {
|
} else if ((emote = ffzemotes.emote({words[i]}))) {
|
||||||
|
@ -175,11 +176,26 @@ QString CommandController::execCommand(const QString &text, ChannelPtr channel,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} // bttv/ffz emote
|
} // bttv/ffz emote
|
||||||
{ // text
|
{ // emoji/text
|
||||||
b.emplace<TextElement>(words[i],
|
for (auto &variant :
|
||||||
MessageElementFlag::Text);
|
app->emotes->emojis.parse(words[i])) {
|
||||||
} // text
|
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);
|
b->flags.set(MessageFlag::DoNotTriggerNotification);
|
||||||
|
@ -189,8 +205,7 @@ QString CommandController::execCommand(const QString &text, ChannelPtr channel,
|
||||||
|
|
||||||
app->twitch.server->sendMessage("jtv", text);
|
app->twitch.server->sendMessage("jtv", text);
|
||||||
|
|
||||||
if (getSettings()->inlineWhispers)
|
if (getSettings()->inlineWhispers) {
|
||||||
{
|
|
||||||
app->twitch.server->forEachChannel(
|
app->twitch.server->forEachChannel(
|
||||||
[&messagexD](ChannelPtr _channel) {
|
[&messagexD](ChannelPtr _channel) {
|
||||||
_channel->addMessage(messagexD);
|
_channel->addMessage(messagexD);
|
||||||
|
|
Loading…
Reference in a new issue