Made the current channels emotes appear at the top of the emote picker (#2057)

This commit is contained in:
Dave 2020-10-11 06:31:00 -04:00 committed by GitHub
parent 528db4ba7a
commit 56828f2d81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View file

@ -2,6 +2,7 @@
## Unversioned
- Minor: Made the current channels emotes appear at the top of the emote picker popup.
- Minor: Added viewer list button to twitch channel header. (#1978)
- Minor: Added followage and subage information to usercard. (#2023)
- Minor: Added an option to only open channels specified in command line with `-c` parameter. You can also use `--help` to display short help message (#1940)

View file

@ -61,7 +61,7 @@ namespace {
}
void addEmoteSets(
std::vector<std::shared_ptr<TwitchAccount::EmoteSet>> sets,
Channel &globalChannel, Channel &subChannel)
Channel &globalChannel, Channel &subChannel, QString currentChannelName)
{
QMap<QString, QPair<bool, std::vector<MessagePtr>>> mapOfSets;
@ -100,6 +100,14 @@ namespace {
// Output to channel all created messages,
// That contain title or emotes.
// Put current channel emotes at the top
auto currentChannelPair = mapOfSets[currentChannelName];
for (auto message : currentChannelPair.second)
{
subChannel.addMessage(message);
}
mapOfSets.remove(currentChannelName);
foreach (auto pair, mapOfSets)
{
auto &channel = pair.first ? globalChannel : subChannel;
@ -174,7 +182,7 @@ void EmotePopup::loadChannel(ChannelPtr _channel)
// twitch
addEmoteSets(
getApp()->accounts->twitch.getCurrent()->accessEmotes()->emoteSets,
*globalChannel, *subChannel);
*globalChannel, *subChannel, _channel->getName());
// global
addEmotes(*globalChannel, *twitchChannel->globalBttv().emotes(),