feat: Live Emote Updates for 7TV (#4090)

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
nerix
2022-11-13 12:07:41 +01:00
committed by GitHub
parent 8fa89b4073
commit 39f7d8ac4c
35 changed files with 1833 additions and 54 deletions
+19
View File
@@ -46,4 +46,23 @@ EmotePtr cachedOrMakeEmotePtr(
}
}
EmoteMap::const_iterator EmoteMap::findEmote(const QString &emoteNameHint,
const QString &emoteID) const
{
auto it = this->end();
if (!emoteNameHint.isEmpty())
{
it = this->find(EmoteName{emoteNameHint});
}
if (it == this->end() || it->second->id.string != emoteID)
{
it = std::find_if(this->begin(), this->end(),
[emoteID](const auto entry) {
return entry.second->id.string == emoteID;
});
}
return it;
}
} // namespace chatterino