mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
added emojis to colon popup
This commit is contained in:
parent
4d4056ad51
commit
8818f3df18
1 changed files with 12 additions and 0 deletions
|
@ -25,6 +25,16 @@ namespace {
|
||||||
if (emote.first.string.contains(text, Qt::CaseInsensitive))
|
if (emote.first.string.contains(text, Qt::CaseInsensitive))
|
||||||
out.push_back({emote.second, providerName});
|
out.push_back({emote.second, providerName});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void addEmojis(std::vector<_Emote> &out, const EmojiMap &map,
|
||||||
|
const QString &text)
|
||||||
|
{
|
||||||
|
map.each([&](const QString &, const std::shared_ptr<EmojiData> &emoji) {
|
||||||
|
for (auto &&shortCode : emoji->shortCodes)
|
||||||
|
if (shortCode.contains(text, Qt::CaseInsensitive))
|
||||||
|
out.push_back({emoji->emote, "Emoji"});
|
||||||
|
});
|
||||||
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
EmoteInputPopup::EmoteInputPopup(QWidget *parent)
|
EmoteInputPopup::EmoteInputPopup(QWidget *parent)
|
||||||
|
@ -72,6 +82,8 @@ void EmoteInputPopup::updateEmotes(const QString &text, ChannelPtr channel)
|
||||||
addEmotes(emotes, *bttvG, text, "Global BetterTTV");
|
addEmotes(emotes, *bttvG, text, "Global BetterTTV");
|
||||||
if (auto ffzG = tc->globalFfz().emotes())
|
if (auto ffzG = tc->globalFfz().emotes())
|
||||||
addEmotes(emotes, *ffzG, text, "Global FrankerFaceZ");
|
addEmotes(emotes, *ffzG, text, "Global FrankerFaceZ");
|
||||||
|
|
||||||
|
addEmojis(emotes, getApp()->emotes->emojis.emojis, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
this->model_.clear();
|
this->model_.clear();
|
||||||
|
|
Loading…
Reference in a new issue