fixed emotes settings a little bit

This commit is contained in:
fourtf
2018-01-22 22:38:44 +01:00
parent cb6af11b5a
commit 91d45214d9
4 changed files with 134 additions and 120 deletions
+10 -13
View File
@@ -450,36 +450,33 @@ bool TwitchMessageBuilder::tryAppendEmote(QString &emoteString)
singletons::EmoteManager &emoteManager = singletons::EmoteManager::getInstance();
util::EmoteData emoteData;
auto appendEmote = [=](MessageElement::Flags flags) {
this->emplace<EmoteElement>(emoteData, flags);
return true;
};
if (emoteManager.bttvGlobalEmotes.tryGet(emoteString, emoteData)) {
// BTTV Global Emote
return this->appendEmote(emoteData);
return appendEmote(MessageElement::BttvEmote);
} else if (this->twitchChannel != nullptr &&
this->twitchChannel->bttvChannelEmotes->tryGet(emoteString, emoteData)) {
// BTTV Channel Emote
return this->appendEmote(emoteData);
return appendEmote(MessageElement::BttvEmote);
} else if (emoteManager.ffzGlobalEmotes.tryGet(emoteString, emoteData)) {
// FFZ Global Emote
return this->appendEmote(emoteData);
return appendEmote(MessageElement::FfzEmote);
} else if (this->twitchChannel != nullptr &&
this->twitchChannel->ffzChannelEmotes->tryGet(emoteString, emoteData)) {
// FFZ Channel Emote
return this->appendEmote(emoteData);
return appendEmote(MessageElement::FfzEmote);
} else if (emoteManager.getChatterinoEmotes().tryGet(emoteString, emoteData)) {
// Chatterino Emote
return this->appendEmote(emoteData);
return appendEmote(MessageElement::Misc);
}
return false;
}
bool TwitchMessageBuilder::appendEmote(const util::EmoteData &emoteData)
{
this->emplace<EmoteElement>(emoteData, MessageElement::BttvEmote);
// Perhaps check for ignored emotes here?
return true;
}
// fourtf: this is ugly
// maybe put the individual badges into a map instead of this mess
void TwitchMessageBuilder::parseTwitchBadges()
-1
View File
@@ -55,7 +55,6 @@ private:
void appendTwitchEmote(const Communi::IrcPrivateMessage *ircMessage, const QString &emote,
std::vector<std::pair<long, util::EmoteData>> &vec);
bool tryAppendEmote(QString &emoteString);
bool appendEmote(const util::EmoteData &emoteData);
void parseTwitchBadges();
void addChatterinoBadges();