feat: Add Setting to Hide Reply Context (#4224)

This commit is contained in:
nerix 2022-12-07 22:02:54 +01:00 committed by GitHub
parent 4fdcac8ec5
commit ff54b4c8d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 5 deletions

View file

@ -7,6 +7,7 @@
- Minor: Cleared up highlight sound settings (#4194)
- Minor: Tables in settings window will now scroll to newly added rows. (#4216)
- Minor: Added link to streamlink docs for easier user setup. (#4217)
- Minor: Added setting to turn off rendering of reply context. (#4224)
- Bugfix: Fixed highlight sounds not reloading on change properly. (#4194)
- Bugfix: Fixed CTRL + C not working in reply thread popups. (#4209)
- Bugfix: Fixed message input showing as red after removing a message that was more than 500 characters. (#4204)

View file

@ -74,6 +74,11 @@ int stripLeadingReplyMention(const QVariantMap &tags, QString &content)
{
return 0;
}
if (getSettings()->hideReplyContext)
{
// Never strip reply mentions if reply contexts are hidden
return 0;
}
if (const auto it = tags.find("reply-parent-display-name");
it != tags.end())

View file

@ -119,6 +119,7 @@ public:
// BoolSetting collapseLongMessages =
// {"/appearance/messages/collapseLongMessages", false};
BoolSetting hideReplyContext = {"/appearance/hideReplyContext", false};
BoolSetting showReplyButton = {"/appearance/showReplyButton", false};
BoolSetting stripReplyMention = {"/appearance/stripReplyMention", true};
IntSetting collpseMessagesMinLines = {

View file

@ -1127,9 +1127,11 @@ MessageElementFlags ChannelView::getFlags() const
if (this->sourceChannel_ == app->twitch->mentionsChannel)
flags.set(MessageElementFlag::ChannelName);
if (this->context_ == Context::ReplyThread)
if (this->context_ == Context::ReplyThread ||
getSettings()->hideReplyContext)
{
// Don't show inline replies within the ReplyThreadPopup
// or if they're hidden
flags.unset(MessageElementFlag::RepliedMessage);
}

View file

@ -190,6 +190,10 @@ void GeneralPage::initLayout(GeneralPageView &layout)
tabDirectionDropdown->setMinimumWidth(
tabDirectionDropdown->minimumSizeHint().width());
layout.addCheckbox(
"Show message reply context", s.hideReplyContext, true,
"This setting will only affect how messages are shown. You can reply "
"to a message regardless of this setting.");
layout.addCheckbox("Show message reply button", s.showReplyButton);
layout.addCheckbox("Show tab close button", s.showTabCloseButton);
layout.addCheckbox("Always on top", s.windowTopMost, false,
@ -843,10 +847,11 @@ void GeneralPage::initLayout(GeneralPageView &layout)
"message) into one cheermote.");
layout.addCheckbox("Messages in /mentions highlights tab",
s.highlightMentions);
layout.addCheckbox("Strip leading mention in replies", s.stripReplyMention,
true,
"When disabled, messages sent in reply threads will "
"include the @mention for the related thread");
layout.addCheckbox(
"Strip leading mention in replies", s.stripReplyMention, true,
"When disabled, messages sent in reply threads will include the "
"@mention for the related thread. If the reply context is hidden, "
"these mentions will never be stripped.");
// Helix timegate settings
auto helixTimegateGetValue = [](auto val) {