summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-08-30 15:18:30 +0800
committerErik Kundiman <erik@megapahit.org>2024-08-30 15:18:30 +0800
commit1713ef9a05cdbda684a045af1ffa96aff86fd7b4 (patch)
treee02cd9ae74f21002afeffb50c5a8a1d75b8e95eb
parente8b3dfd11c98a276023b90eb9e731b3a38824876 (diff)
Custom channel stream notif sent as if from viewer
As if it was the user typing "/157157 Now playing blabla".
-rw-r--r--indra/newview/llviewermedia_streamingaudio.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/indra/newview/llviewermedia_streamingaudio.cpp b/indra/newview/llviewermedia_streamingaudio.cpp
index 6e3d84b3bf..0bea3e1db6 100644
--- a/indra/newview/llviewermedia_streamingaudio.cpp
+++ b/indra/newview/llviewermedia_streamingaudio.cpp
@@ -108,6 +108,8 @@ void LLStreamingAudio_MediaPlugins::update()
mMediaPlugin->idle();
}
+extern void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel);
+
int LLStreamingAudio_MediaPlugins::isPlaying()
{
if (!mMediaPlugin)
@@ -120,10 +122,18 @@ int LLStreamingAudio_MediaPlugins::isPlaying()
{
mTitle = mMediaPlugin->getMediaTitle();
mNowPlaying = nowPlaying;
- LLChat chat{llformat("Now playing %s.", nowPlaying.c_str())};
- chat.mFromName = mTitle;
- chat.mSourceType = CHAT_SOURCE_SYSTEM;
- LLNotificationsUI::LLNotificationManager::instance().onChat(chat, LLSD{});
+ auto text = llformat("Now playing %s.", nowPlaying.c_str());
+ if (gSavedSettings.getBOOL("StreamNotificationChannelEnabled"))
+ {
+ send_chat_from_viewer(text, CHAT_TYPE_NORMAL, gSavedSettings.getS32("StreamNotificationChannel"));
+ }
+ else
+ {
+ LLChat chat{text};
+ chat.mFromName = mTitle;
+ chat.mSourceType = CHAT_SOURCE_SYSTEM;
+ LLNotificationsUI::LLNotificationManager::instance().onChat(chat, LLSD{});
+ }
}
switch (status)