mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
remove unused variable, format
This commit is contained in:
parent
d2e43d78fc
commit
a5bed6d7e4
1 changed files with 15 additions and 10 deletions
|
@ -175,8 +175,10 @@ MessagePtr TwitchMessageBuilder::build()
|
||||||
{
|
{
|
||||||
QStringList emoteString = iterator.value().toString().split('/');
|
QStringList emoteString = iterator.value().toString().split('/');
|
||||||
std::vector<int> correctPositions;
|
std::vector<int> correctPositions;
|
||||||
for (int i = 0; i < this->originalMessage_.size(); ++i) {
|
for (int i = 0; i < this->originalMessage_.size(); ++i)
|
||||||
if (!this->originalMessage_.at(i).isLowSurrogate()) {
|
{
|
||||||
|
if (!this->originalMessage_.at(i).isLowSurrogate())
|
||||||
|
{
|
||||||
correctPositions.push_back(i);
|
correctPositions.push_back(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -184,13 +186,11 @@ MessagePtr TwitchMessageBuilder::build()
|
||||||
{
|
{
|
||||||
this->appendTwitchEmote(emote, twitchEmotes, correctPositions);
|
this->appendTwitchEmote(emote, twitchEmotes, correctPositions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
auto app = getApp();
|
auto app = getApp();
|
||||||
const auto &phrases = app->ignores->phrases.getVector();
|
const auto &phrases = app->ignores->phrases.getVector();
|
||||||
auto removeEmotesInRange =
|
auto removeEmotesInRange =
|
||||||
[&message = this->originalMessage_](int pos, int len,
|
[](int pos, int len,
|
||||||
std::vector<std::tuple<int, EmotePtr, EmoteName>>
|
std::vector<std::tuple<int, EmotePtr, EmoteName>>
|
||||||
&twitchEmotes) mutable {
|
&twitchEmotes) mutable {
|
||||||
auto it =
|
auto it =
|
||||||
|
@ -985,19 +985,24 @@ Outcome TwitchMessageBuilder::tryAppendEmote(const EmoteName &name)
|
||||||
{
|
{
|
||||||
// Special channels, like /whispers and /channels return here
|
// Special channels, like /whispers and /channels return here
|
||||||
// This means they will not render any BTTV or FFZ emotes
|
// This means they will not render any BTTV or FFZ emotes
|
||||||
if (this->twitchChannel == nullptr) {
|
if (this->twitchChannel == nullptr)
|
||||||
|
{
|
||||||
auto *app = getApp();
|
auto *app = getApp();
|
||||||
const auto &bttvemotes = app->twitch.server->getBttvEmotes();
|
const auto &bttvemotes = app->twitch.server->getBttvEmotes();
|
||||||
const auto &ffzemotes = app->twitch.server->getFfzEmotes();
|
const auto &ffzemotes = app->twitch.server->getFfzEmotes();
|
||||||
auto flags = MessageElementFlags();
|
auto flags = MessageElementFlags();
|
||||||
auto emote = boost::optional<EmotePtr>{};
|
auto emote = boost::optional<EmotePtr>{};
|
||||||
{ // bttv/ffz emote
|
{ // bttv/ffz emote
|
||||||
if ((emote = bttvemotes.emote(name))) {
|
if ((emote = bttvemotes.emote(name)))
|
||||||
|
{
|
||||||
flags = MessageElementFlag::BttvEmote;
|
flags = MessageElementFlag::BttvEmote;
|
||||||
} else if ((emote = ffzemotes.emote(name))) {
|
}
|
||||||
|
else if ((emote = ffzemotes.emote(name)))
|
||||||
|
{
|
||||||
flags = MessageElementFlag::FfzEmote;
|
flags = MessageElementFlag::FfzEmote;
|
||||||
}
|
}
|
||||||
if (emote) {
|
if (emote)
|
||||||
|
{
|
||||||
this->emplace<EmoteElement>(emote.get(), flags);
|
this->emplace<EmoteElement>(emote.get(), flags);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue