From 1bd3d10eeff2854dd1b25790b8804ff6b7508405 Mon Sep 17 00:00:00 2001 From: alazymeme Date: Sat, 8 Aug 2020 23:17:51 +1000 Subject: [PATCH] Add an "Open in browser" option to whisper split (#1828) --- CHANGELOG.md | 1 + src/widgets/splits/Split.cpp | 7 +++++++ src/widgets/splits/Split.hpp | 1 + src/widgets/splits/SplitHeader.cpp | 7 +++++++ 4 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f8ff8efde..0774df79d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Major: We now support image thumbnails coming from the link resolver. This feature is off by default and can be enabled in the settings with the "Show link thumbnail" setting. This feature also requires the "Show link info when hovering" setting to be enabled (#1664) - Major: Added image upload functionality to i.nuuls.com with an ability to change upload destination. This works by dragging and dropping an image into a split, or pasting an image into the text edit field. (#1332, #1741) +- Minor: Clicking on `Open in browser` in a whisper split will now open your whispers on twitch. (#1828) - Minor: Clicking on @mentions will open the User Popup. (#1674) - Minor: You can now open the Twitch User Card by middle-mouse clicking a username. (#1669) - Minor: User Popup now also includes recent user messages (#1729) diff --git a/src/widgets/splits/Split.cpp b/src/widgets/splits/Split.cpp index 73c340097..4d9562f42 100644 --- a/src/widgets/splits/Split.cpp +++ b/src/widgets/splits/Split.cpp @@ -543,6 +543,13 @@ void Split::openInBrowser() } } +void Split::openWhispersInBrowser() +{ + auto userName = getApp()->accounts->twitch.getCurrent()->getUserName(); + QDesktopServices::openUrl("https://twitch.tv/popout/moderator/" + userName + + "/whispers"); +} + void Split::openBrowserPlayer() { ChannelPtr channel = this->getChannel(); diff --git a/src/widgets/splits/Split.hpp b/src/widgets/splits/Split.hpp index c4ef428a3..ea2d740f5 100644 --- a/src/widgets/splits/Split.hpp +++ b/src/widgets/splits/Split.hpp @@ -127,6 +127,7 @@ public slots: void popup(); void clear(); void openInBrowser(); + void openWhispersInBrowser(); void openBrowserPlayer(); void openInStreamlink(); void openWithCustomScheme(); diff --git a/src/widgets/splits/SplitHeader.cpp b/src/widgets/splits/SplitHeader.cpp index 63cb63f93..d41ec53be 100644 --- a/src/widgets/splits/SplitHeader.cpp +++ b/src/widgets/splits/SplitHeader.cpp @@ -316,6 +316,13 @@ std::unique_ptr SplitHeader::createMainMenu() menu->addSeparator(); } + if (this->split_->getChannel()->getType() == Channel::Type::TwitchWhispers) + { + menu->addAction(OPEN_IN_BROWSER, this->split_, + &Split::openWhispersInBrowser); + menu->addSeparator(); + } + { // "How to..." sub menu auto subMenu = new QMenu("How to...", this);