mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Fix crash and completion in other special channels than /whispers (#3033)
This commit is contained in:
parent
89b86b94e7
commit
9f2fc90928
|
@ -3,7 +3,7 @@
|
|||
## Unversioned
|
||||
|
||||
- Major: Newly uploaded Twitch emotes are once again present in emote picker and can be autocompleted with Tab as well. (#2992)
|
||||
- Minor: Added autocompletion in /whispers for Twitch emotes, Global Bttv/Ffz emotes and emojis. (#2999)
|
||||
- Minor: Added autocompletion in /whispers for Twitch emotes, Global Bttv/Ffz emotes and emojis. (#2999, #3033)
|
||||
- Minor: Received Twitch messages now use the exact same timestamp (obtained from Twitch's server) for every Chatterino user instead of assuming message timestamp on client's side. (#3021)
|
||||
- Minor: Received IRC messages use `time` message tag for timestamp if it's available. (#3021)
|
||||
- Bugfix: Fixed "smiley" emotes being unable to be "Tabbed" with autocompletion, introduced in v2.3.3. (#3010)
|
||||
|
|
|
@ -75,8 +75,8 @@ void InputCompletionPopup::updateEmotes(const QString &text, ChannelPtr channel)
|
|||
{
|
||||
std::vector<_Emote> emotes;
|
||||
auto tc = dynamic_cast<TwitchChannel *>(channel.get());
|
||||
auto wc = channel.get()->getType() == Channel::Type::TwitchWhispers;
|
||||
if (tc || wc)
|
||||
// returns true also for special Twitch channels (/live, /mentions, /whispers, etc.)
|
||||
if (channel->isTwitchChannel())
|
||||
{
|
||||
if (auto user = getApp()->accounts->twitch.getCurrent())
|
||||
{
|
||||
|
@ -86,7 +86,8 @@ void InputCompletionPopup::updateEmotes(const QString &text, ChannelPtr channel)
|
|||
|
||||
// Twitch Emotes available locally
|
||||
auto localEmoteData = user->accessLocalEmotes();
|
||||
if (localEmoteData->find(tc->roomId()) != localEmoteData->end())
|
||||
if (tc &&
|
||||
localEmoteData->find(tc->roomId()) != localEmoteData->end())
|
||||
{
|
||||
if (auto localEmotes = &localEmoteData->at(tc->roomId()))
|
||||
{
|
||||
|
@ -103,13 +104,13 @@ void InputCompletionPopup::updateEmotes(const QString &text, ChannelPtr channel)
|
|||
addEmotes(emotes, *bttv, text, "Channel BetterTTV");
|
||||
if (auto ffz = tc->ffzEmotes())
|
||||
addEmotes(emotes, *ffz, text, "Channel FrankerFaceZ");
|
||||
|
||||
if (auto bttvG = getApp()->twitch2->getBttvEmotes().emotes())
|
||||
addEmotes(emotes, *bttvG, text, "Global BetterTTV");
|
||||
if (auto ffzG = getApp()->twitch2->getFfzEmotes().emotes())
|
||||
addEmotes(emotes, *ffzG, text, "Global FrankerFaceZ");
|
||||
}
|
||||
|
||||
if (auto bttvG = getApp()->twitch2->getBttvEmotes().emotes())
|
||||
addEmotes(emotes, *bttvG, text, "Global BetterTTV");
|
||||
if (auto ffzG = getApp()->twitch2->getFfzEmotes().emotes())
|
||||
addEmotes(emotes, *ffzG, text, "Global FrankerFaceZ");
|
||||
|
||||
addEmojis(emotes, getApp()->emotes->emojis.emojis, text);
|
||||
}
|
||||
|
||||
|
|
|
@ -464,8 +464,7 @@ void SplitInput::updateCompletionPopup()
|
|||
auto channel = this->split_->getChannel().get();
|
||||
auto tc = dynamic_cast<TwitchChannel *>(channel);
|
||||
bool showEmoteCompletion =
|
||||
getSettings()->emoteCompletionWithColon &&
|
||||
(tc || (channel->getType() == Channel::Type::TwitchWhispers));
|
||||
channel->isTwitchChannel() && getSettings()->emoteCompletionWithColon;
|
||||
bool showUsernameCompletion =
|
||||
tc && getSettings()->showUsernameCompletionMenu;
|
||||
if (!showEmoteCompletion && !showUsernameCompletion)
|
||||
|
|
Loading…
Reference in a new issue