feat: add setting to show title in live message (#6572)

Reviewed-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
Supa
2025-11-15 15:24:13 +02:00
committed by GitHub
parent fa45fdecd1
commit 0b4e2312ff
7 changed files with 34 additions and 4 deletions
+1
View File
@@ -10,6 +10,7 @@
- Minor: Consolidate font picking into one dialog. (#6531)
- Minor: Added a menu action to sort tabs alphabetically. (#6551)
- Minor: Fixed "edit hotkey" dialog opening like a normal window. (#6540)
- Minor: Added a setting to show the stream title in live messages. (#6572)
- Bugfix: Expose the "Extra extension IDs" setting on non-Windows systems too. (#6509)
- Bugfix: Fixed some commands and filters not working as expected in seach popups. (#6539)
- Bugfix: Fixed settings occasionally not opening when clicking on "Manage Accounts" in the account switcher. (#6543)
@@ -138,7 +138,8 @@ void NotificationController::notifyTwitchChannelLive(
// Message in /live channel
getApp()->getTwitch()->getLiveChannel()->addMessage(
MessageBuilder::makeLiveMessage(payload.displayName, payload.channelId),
MessageBuilder::makeLiveMessage(payload.displayName, payload.channelId,
payload.title),
MessageContext::Original);
// Notify on all channels with a ping sound
+18 -3
View File
@@ -1153,6 +1153,7 @@ MessagePtr MessageBuilder::makeChannelPointRewardMessage(
MessagePtr MessageBuilder::makeLiveMessage(const QString &channelName,
const QString &channelID,
const QString &title,
MessageFlags extraFlags)
{
MessageBuilder builder;
@@ -1162,9 +1163,23 @@ MessagePtr MessageBuilder::makeLiveMessage(const QString &channelName,
.emplace<TextElement>(channelName, MessageElementFlag::Username,
MessageColor::Text, FontStyle::ChatMediumBold)
->setLink({Link::UserInfo, channelName});
builder.emplace<TextElement>("is live!", MessageElementFlag::Text,
MessageColor::Text);
auto text = QString("%1 is live!").arg(channelName);
QString text;
if (getSettings()->showTitleInLiveMessage)
{
text = QString("%1 is live: %2").arg(channelName, title);
builder.emplace<TextElement>("is live:", MessageElementFlag::Text,
MessageColor::Text);
builder.emplace<TextElement>(title, MessageElementFlag::Text,
MessageColor::Text);
}
else
{
text = QString("%1 is live!").arg(channelName);
builder.emplace<TextElement>("is live!", MessageElementFlag::Text,
MessageColor::Text);
}
builder.message().messageText = text;
builder.message().searchText = text;
builder.message().id = channelID;
+1
View File
@@ -175,6 +175,7 @@ public:
/// Make a "CHANNEL_NAME has gone live!" message
static MessagePtr makeLiveMessage(const QString &channelName,
const QString &channelID,
const QString &title,
MessageFlags extraFlags = {});
// Messages in normal chat for channel stuff
+1
View File
@@ -641,6 +641,7 @@ void TwitchChannel::onLiveStatusChanged(bool isLive, bool isInitialUpdate)
this->addMessage(
MessageBuilder::makeLiveMessage(
this->getDisplayName(), this->roomId(),
this->accessStreamStatus()->title,
{MessageFlag::System, MessageFlag::DoNotTriggerNotification}),
MessageContext::Original);
}
+4
View File
@@ -691,6 +691,10 @@ public:
true};
BoolSetting lockNotebookLayout = {"/misc/lockNotebookLayout", false};
BoolSetting showPronouns = {"/misc/showPronouns", false};
BoolSetting showTitleInLiveMessage = {
"/extraChannels/live/showTitle",
false,
};
/// UI
@@ -1285,6 +1285,13 @@ void GeneralPage::initLayout(GeneralPageView &layout)
R"(Pronouns are retrieved from <a href="https://pr.alejo.io">pr.alejo.io</a> when a user card is opened.)")
->addTo(layout);
SettingWidget::checkbox("Show stream title in live message",
s.showTitleInLiveMessage)
->setTooltip("The title in the message will be the title the streamer "
"set when they went live, and will not update as the "
"streamer updates their title.")
->addTo(layout);
SettingWidget::checkbox("Bold @usernames", s.boldUsernames)
->setTooltip("Bold @mentions to make them more noticeable.")
->addTo(layout);