diff --git a/CHANGELOG.md b/CHANGELOG.md index 1209a78c1..bf1f2660b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ - Minor: Add workaround for multipart emoji as described in [the RFC](https://mm2pl.github.io/emoji_rfc.pdf). (#3469) - Minor: Add feedback when using the whisper command `/w` incorrectly. (#3439) - Minor: Add feedback when writing a non-command message in the `/whispers` split. (#3439) +- Minor: Opening streamlink through hotkeys and/or split header menu matches `/streamlink` command and shows feedback in chat as well. (#3510) - Bugfix: Fix Split Input hotkeys not being available when input is hidden (#3362) - Bugfix: Fixed colored usernames sometimes not working. (#3170) - Bugfix: Restored ability to send duplicate `/me` messages. (#3166) diff --git a/src/controllers/commands/CommandController.cpp b/src/controllers/commands/CommandController.cpp index b304259c5..21e192172 100644 --- a/src/controllers/commands/CommandController.cpp +++ b/src/controllers/commands/CommandController.cpp @@ -670,8 +670,6 @@ void CommandController::initialize(Settings &, Paths &paths) } stripChannelName(target); - channel->addMessage(makeSystemMessage( - QString("Opening %1 in streamlink...").arg(target))); openStreamlinkForChannel(target); return ""; diff --git a/src/util/StreamLink.cpp b/src/util/StreamLink.cpp index 8b61ca9d7..ecd6242d4 100644 --- a/src/util/StreamLink.cpp +++ b/src/util/StreamLink.cpp @@ -1,10 +1,14 @@ #include "util/StreamLink.hpp" #include "Application.hpp" +#include "providers/irc/IrcMessageBuilder.hpp" #include "singletons/Settings.hpp" +#include "singletons/WindowManager.hpp" #include "util/Helpers.hpp" #include "util/SplitCommand.hpp" +#include "widgets/Window.hpp" #include "widgets/dialogs/QualityPopup.hpp" +#include "widgets/splits/Split.hpp" #include #include @@ -205,6 +209,20 @@ void openStreamlink(const QString &channelURL, const QString &quality, void openStreamlinkForChannel(const QString &channel) { + static const QString INFO_TEMPLATE("Opening %1 in Streamlink ..."); + + auto *currentPage = dynamic_cast( + getApp()->windows->getMainWindow().getNotebook().getSelectedPage()); + if (currentPage != nullptr) + { + if (auto currentSplit = currentPage->getSelectedSplit(); + currentSplit != nullptr) + { + currentSplit->getChannel()->addMessage( + makeSystemMessage(INFO_TEMPLATE.arg(channel))); + } + } + QString channelURL = "twitch.tv/" + channel; QString preferredQuality = getSettings()->preferredQuality.getValue();