Added emote completion with : to the whispers channel (#2076)

This commit is contained in:
yodax 2020-10-17 09:59:15 -04:00 committed by GitHub
parent fb6b65faaa
commit 55b98f93db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 12 deletions

View file

@ -4,6 +4,7 @@
- Minor: Improved viewer list window. - 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) - 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: 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 viewer list button to twitch channel header. (#1978)
- Minor: Added followage and subage information to usercard. (#2023) - Minor: Added followage and subage information to usercard. (#2023)

View file

@ -72,8 +72,9 @@ void EmoteInputPopup::initLayout()
void EmoteInputPopup::updateEmotes(const QString &text, ChannelPtr channel) void EmoteInputPopup::updateEmotes(const QString &text, ChannelPtr channel)
{ {
std::vector<_Emote> emotes; std::vector<_Emote> emotes;
auto tc = dynamic_cast<TwitchChannel *>(channel.get());
if (auto tc = dynamic_cast<TwitchChannel *>(channel.get())) auto wc = channel.get()->getType() == Channel::Type::TwitchWhispers;
if (tc || wc)
{ {
if (auto user = getApp()->accounts->twitch.getCurrent()) if (auto user = getApp()->accounts->twitch.getCurrent())
{ {
@ -81,6 +82,8 @@ void EmoteInputPopup::updateEmotes(const QString &text, ChannelPtr channel)
addEmotes(emotes, twitch->emotes, text, "Twitch Emote"); addEmotes(emotes, twitch->emotes, text, "Twitch Emote");
} }
if (tc)
{
// TODO extract "Channel BetterTTV" text into a #define. // TODO extract "Channel BetterTTV" text into a #define.
if (auto bttv = tc->bttvEmotes()) if (auto bttv = tc->bttvEmotes())
addEmotes(emotes, *bttv, text, "Channel BetterTTV"); addEmotes(emotes, *bttv, text, "Channel BetterTTV");
@ -91,6 +94,7 @@ void EmoteInputPopup::updateEmotes(const QString &text, ChannelPtr channel)
addEmotes(emotes, *bttvG, text, "Global BetterTTV"); addEmotes(emotes, *bttvG, text, "Global BetterTTV");
if (auto ffzG = tc->globalFfz().emotes()) if (auto ffzG = tc->globalFfz().emotes())
addEmotes(emotes, *ffzG, text, "Global FrankerFaceZ"); addEmotes(emotes, *ffzG, text, "Global FrankerFaceZ");
}
addEmojis(emotes, getApp()->emotes->emojis.emojis, text); addEmojis(emotes, getApp()->emotes->emojis.emojis, text);
} }

View file

@ -460,8 +460,10 @@ void SplitInput::onCursorPositionChanged()
void SplitInput::updateColonMenu() void SplitInput::updateColonMenu()
{ {
auto channel = this->split_->getChannel().get();
if (!getSettings()->emoteCompletionWithColon || if (!getSettings()->emoteCompletionWithColon ||
!dynamic_cast<TwitchChannel *>(this->split_->getChannel().get())) (!dynamic_cast<TwitchChannel *>(channel) &&
!(channel->getType() == Channel::Type::TwitchWhispers)))
{ {
this->hideColonMenu(); this->hideColonMenu();
return; return;