fix: no longer crash on clip creation in "special" channels (#2528)

This commit is contained in:
Leon Richardt 2021-03-15 17:45:56 +01:00 committed by GitHub
parent 49bd1bd488
commit 3f206d46af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

View file

@ -2,7 +2,7 @@
## Unversioned ## Unversioned
- Major: Added clip creation support. You can create clips with `/clip` command, `Alt+X` keybind or `Create a clip` option in split header's context menu. This requires a new authentication scope so re-authentication will be required to use it. (#2271, #2377) - Major: Added clip creation support. You can create clips with `/clip` command, `Alt+X` keybind or `Create a clip` option in split header's context menu. This requires a new authentication scope so re-authentication will be required to use it. (#2271, #2377, #2528)
- Major: Added "Channel Filters". See https://wiki.chatterino.com/Filters/ for how they work or how to configure them. (#1748, #2083, #2090, #2200, #2225) - Major: Added "Channel Filters". See https://wiki.chatterino.com/Filters/ for how they work or how to configure them. (#1748, #2083, #2090, #2200, #2225)
- 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, #2316, #2342, #2376) - 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, #2316, #2342, #2376)
- Major: Color mentions to match the mentioned users. You can disable this by unchecking "Color @usernames" under `Settings -> General -> Advanced (misc.)`. (#1963, #2284) - Major: Color mentions to match the mentioned users. You can disable this by unchecking "Color @usernames" under `Settings -> General -> Advanced (misc.)`. (#1963, #2284)

View file

@ -523,7 +523,9 @@ void CommandController::initialize(Settings &, Paths &paths)
}); });
this->registerCommand("/clip", [](const auto & /*words*/, auto channel) { this->registerCommand("/clip", [](const auto & /*words*/, auto channel) {
if (!channel->isTwitchChannel()) if (const auto type = channel->getType();
type != Channel::Type::Twitch &&
type != Channel::Type::TwitchWatching)
{ {
return ""; return "";
} }

View file

@ -123,7 +123,9 @@ Split::Split(QWidget *parent)
// Alt+X: create clip LUL // Alt+X: create clip LUL
createShortcut(this, "Alt+X", [this] { createShortcut(this, "Alt+X", [this] {
if (!this->getChannel()->isTwitchChannel()) if (const auto type = this->getChannel()->getType();
type != Channel::Type::Twitch &&
type != Channel::Type::TwitchWatching)
{ {
return; return;
} }