Make TwitchEmotes class conform to QString standard

Make twitch emotes only be identified by a string ID, instead of sometimes by a string and sometimes by an int

Make the EmoteSet a struct instead of just a vector of emotes. This will be handy when we later fill in the emote sets name and other info (i.e. whether it's a subscription benifit or not)
This commit is contained in:
Rasmus Karlsson
2018-06-07 13:01:06 +02:00
parent 3bc7e2da8a
commit 93fe7adce7
4 changed files with 54 additions and 40 deletions
+2 -4
View File
@@ -102,13 +102,11 @@ void EmotePopup::loadChannel(ChannelPtr _channel)
builder2.getMessage()->flags |= Message::Centered;
builder2.getMessage()->flags |= Message::DisableCompactEmotes;
for (const auto &emote : set.second) {
for (const auto &emote : set.emotes) {
[&](const QString &key, const util::EmoteData &value) {
builder2.append((new EmoteElement(value, MessageElement::Flags::AlwaysShow))
->setLink(Link(Link::InsertText, key)));
}(QString::fromStdString(emote.code),
app->emotes->twitch.getEmoteById(QString::fromStdString(emote.id).toLong(),
QString::fromStdString(emote.code)));
}(emote.code, app->emotes->twitch.getEmoteById(emote.id, emote.code));
}
emoteChannel->addMessage(builder2.getMessage());