From 10e14ceee2c91e87e088693f2e8c7a375dc0c2cf Mon Sep 17 00:00:00 2001 From: Tonya Souther Date: Thu, 17 Mar 2011 09:54:31 -0500 Subject: [PATCH] Properly handle the case where the artist is present but the title is not. --- indra/newview/streamtitledisplay.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/indra/newview/streamtitledisplay.cpp b/indra/newview/streamtitledisplay.cpp index 14fa387437..ece974c1fc 100644 --- a/indra/newview/streamtitledisplay.cpp +++ b/indra/newview/streamtitledisplay.cpp @@ -55,16 +55,22 @@ void StreamTitleDisplay::checkMetadata() std::string title = gAudiop->getStreamingAudioImpl()->getCurrentTitle(); std::string artist = gAudiop->getStreamingAudioImpl()->getCurrentArtist(); // Sometimes we get blanks... + chat.mText = ""; + if(artist.length() > 0) + { + chat.mText = artist; + } if(title.length() > 0) { - if(artist.length() > 0) + if (chat.mText.length() > 0) { - chat.mText = "Now playing: " + artist + " - " + title; - } - else - { - chat.mText = "Now playing: " + title; + chat.mText += " - "; } + chat.mText += title; + } + if (chat.mText.length() > 0) + { + chat.mText = "Now playing: " + chat.mText; chat.mSourceType = CHAT_SOURCE_SYSTEM; LLSD args; args["type"] = LLNotificationsUI::NT_NEARBYCHAT;