mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Made the current channels emotes appear at the top of the emote picker (#2057)
This commit is contained in:
parent
528db4ba7a
commit
56828f2d81
|
@ -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)
|
||||
|
|
|
@ -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(),
|
||||
|
|
Loading…
Reference in a new issue