From 55b98f93dba8bbfaa0e0363a62cf8ac5d386d312 Mon Sep 17 00:00:00 2001 From: yodax Date: Sat, 17 Oct 2020 09:59:15 -0400 Subject: [PATCH] Added emote completion with `:` to the whispers channel (#2076) --- CHANGELOG.md | 1 + src/widgets/splits/EmoteInputPopup.cpp | 26 +++++++++++++++----------- src/widgets/splits/SplitInput.cpp | 4 +++- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6aa579ad..adc9606d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Minor: Improved viewer list window. - Major: Added Streamer Mode configuration (under `Settings -> General`), where you can select which features of Chatterino should behave differently when you are in Streamer Mode. (#2001) +- Minor: Added emote completion with `:` to the whispers channel (#2075) - Minor: Made the current channels emotes appear at the top of the emote picker popup. (#2057) - Minor: Added viewer list button to twitch channel header. (#1978) - Minor: Added followage and subage information to usercard. (#2023) diff --git a/src/widgets/splits/EmoteInputPopup.cpp b/src/widgets/splits/EmoteInputPopup.cpp index bd3d26ea1..7a596e048 100644 --- a/src/widgets/splits/EmoteInputPopup.cpp +++ b/src/widgets/splits/EmoteInputPopup.cpp @@ -72,8 +72,9 @@ void EmoteInputPopup::initLayout() void EmoteInputPopup::updateEmotes(const QString &text, ChannelPtr channel) { std::vector<_Emote> emotes; - - if (auto tc = dynamic_cast(channel.get())) + auto tc = dynamic_cast(channel.get()); + auto wc = channel.get()->getType() == Channel::Type::TwitchWhispers; + if (tc || wc) { if (auto user = getApp()->accounts->twitch.getCurrent()) { @@ -81,16 +82,19 @@ void EmoteInputPopup::updateEmotes(const QString &text, ChannelPtr channel) addEmotes(emotes, twitch->emotes, text, "Twitch Emote"); } - // TODO extract "Channel BetterTTV" text into a #define. - if (auto bttv = tc->bttvEmotes()) - addEmotes(emotes, *bttv, text, "Channel BetterTTV"); - if (auto ffz = tc->ffzEmotes()) - addEmotes(emotes, *ffz, text, "Channel FrankerFaceZ"); + if (tc) + { + // TODO extract "Channel BetterTTV" text into a #define. + if (auto bttv = tc->bttvEmotes()) + addEmotes(emotes, *bttv, text, "Channel BetterTTV"); + if (auto ffz = tc->ffzEmotes()) + addEmotes(emotes, *ffz, text, "Channel FrankerFaceZ"); - if (auto bttvG = tc->globalBttv().emotes()) - addEmotes(emotes, *bttvG, text, "Global BetterTTV"); - if (auto ffzG = tc->globalFfz().emotes()) - addEmotes(emotes, *ffzG, text, "Global FrankerFaceZ"); + if (auto bttvG = tc->globalBttv().emotes()) + addEmotes(emotes, *bttvG, text, "Global BetterTTV"); + if (auto ffzG = tc->globalFfz().emotes()) + addEmotes(emotes, *ffzG, text, "Global FrankerFaceZ"); + } addEmojis(emotes, getApp()->emotes->emojis.emojis, text); } diff --git a/src/widgets/splits/SplitInput.cpp b/src/widgets/splits/SplitInput.cpp index 713e0153f..06e28e69e 100644 --- a/src/widgets/splits/SplitInput.cpp +++ b/src/widgets/splits/SplitInput.cpp @@ -460,8 +460,10 @@ void SplitInput::onCursorPositionChanged() void SplitInput::updateColonMenu() { + auto channel = this->split_->getChannel().get(); if (!getSettings()->emoteCompletionWithColon || - !dynamic_cast(this->split_->getChannel().get())) + (!dynamic_cast(channel) && + !(channel->getType() == Channel::Type::TwitchWhispers))) { this->hideColonMenu(); return;