diff --git a/src/widgets/splits/Split.cpp b/src/widgets/splits/Split.cpp index 7dee06a48..7aa21a1df 100644 --- a/src/widgets/splits/Split.cpp +++ b/src/widgets/splits/Split.cpp @@ -1,5 +1,6 @@ #include "widgets/splits/Split.hpp" +#include "controllers/accounts/AccountController.hpp" #include "common/Common.hpp" #include "common/NetworkRequest.hpp" #include "debug/Log.hpp" @@ -105,6 +106,9 @@ Split::Split(QWidget *parent) // CTRL+F: Search createShortcut(this, "CTRL+F", &Split::showSearch); + // F5: reload emotes + createShortcut(this, "F6", &Split::reloadChannelAndSubscriberEmotes); + // F12 createShortcut(this, "F10", [] { auto *popup = new DebugPopup; @@ -646,6 +650,16 @@ void Split::showSearch() popup->show(); } +void Split::reloadChannelAndSubscriberEmotes() +{ + getApp()->accounts->twitch.getCurrent()->loadEmotes(); + auto channel = this->getChannel(); + + if (auto twitchChannel = dynamic_cast(channel.get())) + twitchChannel->refreshChannelEmotes(); +} + + template static Iter select_randomly(Iter start, Iter end, RandomGenerator &g) { diff --git a/src/widgets/splits/Split.hpp b/src/widgets/splits/Split.hpp index 3708e7a1a..a41be31e1 100644 --- a/src/widgets/splits/Split.hpp +++ b/src/widgets/splits/Split.hpp @@ -130,6 +130,7 @@ public slots: void copyToClipboard(); void showSearch(); void showViewerList(); + void reloadChannelAndSubscriberEmotes(); }; } // namespace chatterino