Change order of query parameters of Twitch Player URLs. (#5326)
This ensures that it doesn't "fake redirect". Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -14,6 +14,9 @@
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
const inline auto TWITCH_PLAYER_URL =
|
||||
QStringLiteral("https://player.twitch.tv/?channel=%1&parent=twitch.tv");
|
||||
|
||||
enum class HighlightState {
|
||||
None,
|
||||
Highlighted,
|
||||
|
||||
@@ -84,8 +84,7 @@ TwitchChannel::TwitchChannel(const QString &name)
|
||||
, nameOptions{name, name, name}
|
||||
, subscriptionUrl_("https://www.twitch.tv/subs/" + name)
|
||||
, channelUrl_("https://twitch.tv/" + name)
|
||||
, popoutPlayerUrl_("https://player.twitch.tv/?parent=twitch.tv&channel=" +
|
||||
name)
|
||||
, popoutPlayerUrl_(TWITCH_PLAYER_URL.arg(name))
|
||||
, bttvEmotes_(std::make_shared<EmoteMap>())
|
||||
, ffzEmotes_(std::make_shared<EmoteMap>())
|
||||
, seventvEmotes_(std::make_shared<EmoteMap>())
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "Toasts.hpp"
|
||||
|
||||
#include "Application.hpp"
|
||||
#include "common/Common.hpp"
|
||||
#include "common/Literals.hpp"
|
||||
#include "common/QLogging.hpp"
|
||||
#include "common/Version.hpp"
|
||||
@@ -177,9 +178,8 @@ public:
|
||||
case ToastReaction::OpenInPlayer:
|
||||
if (platform_ == Platform::Twitch)
|
||||
{
|
||||
QDesktopServices::openUrl(QUrl(
|
||||
u"https://player.twitch.tv/?parent=twitch.tv&channel=" %
|
||||
channelName_));
|
||||
QDesktopServices::openUrl(
|
||||
QUrl(TWITCH_PLAYER_URL.arg(channelName_)));
|
||||
}
|
||||
break;
|
||||
case ToastReaction::OpenInStreamlink: {
|
||||
|
||||
@@ -836,8 +836,7 @@ void Split::openChannelInBrowserPlayer(ChannelPtr channel)
|
||||
if (auto *twitchChannel = dynamic_cast<TwitchChannel *>(channel.get()))
|
||||
{
|
||||
QDesktopServices::openUrl(
|
||||
"https://player.twitch.tv/?parent=twitch.tv&channel=" +
|
||||
twitchChannel->getName());
|
||||
QUrl(TWITCH_PLAYER_URL.arg(twitchChannel->getName())));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user