diff --git a/indra/newview/llpanellandaudio.cpp b/indra/newview/llpanellandaudio.cpp
index e76543a585..a6f320c964 100644
--- a/indra/newview/llpanellandaudio.cpp
+++ b/indra/newview/llpanellandaudio.cpp
@@ -169,7 +169,10 @@ void LLPanelLandAudio::refresh()
std::string current_url = parcel->getMusicURL();
mMusicURLEdit->clearRows();
LLSD streamlist = gSavedSettings.getLLSD("FSStreamList");
- LLSD streams = streamlist["audio"];
+ // FIRE-29157 - Remove invalid URLs that were rejected by the server
+ //LLSD streams = streamlist["audio"];
+ LLSD& streams = streamlist["audio"];
+ //
for(LLSD::array_iterator s_itr = streams.beginArray(); s_itr != streams.endArray(); ++s_itr)
{
@@ -186,6 +189,23 @@ void LLPanelLandAudio::refresh()
//
mMusicURLEdit->setEnabled( can_change_media );
+ // FIRE-29157 - Remove invalid URLs that were rejected by the server
+ if (current_url != mLastSetURL)
+ {
+ mMusicURLEdit->remove(mLastSetURL);
+ LLSD::Integer index = 0;
+ for (LLSD::array_iterator iter = streams.beginArray(), end = streams.endArray(); iter != end; ++iter, ++index)
+ {
+ if ((*iter).asString() == mLastSetURL)
+ {
+ streams.erase(index);
+ break;
+ }
+ }
+ gSavedSettings.setLLSD("FSStreamList", streamlist);
+ }
+ //
+
BOOL can_change_av_sounds = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_OPTIONS) && parcel->getHaveNewParcelLimitData();
mCheckAVSoundAny->set(parcel->getAllowAnyAVSounds());
mCheckAVSoundAny->setEnabled(can_change_av_sounds);
@@ -232,6 +252,10 @@ void LLPanelLandAudio::onCommitAny(LLUICtrl*, void *userdata)
}
//
+ // FIRE-29157 - Remove invalid URLs that were rejected by the server
+ self->mLastSetURL = music_url;
+ //
+
// Push data into current parcel
parcel->setParcelFlag(PF_ALLOW_VOICE_CHAT, voice_enabled);
parcel->setParcelFlag(PF_USE_ESTATE_VOICE_CHAN, voice_estate_chan);
@@ -281,6 +305,13 @@ void LLPanelLandAudio::onBtnStreamDelete()
{
std::string music_url = mMusicURLEdit->getSimple();
LLStringUtil::trim(music_url);
+ // FIRE-29157 - Stream can't be deleted if onCommitAny() prepended "http://" to the URL since it doesn't match in the list.
+ std::string music_url_no_http;
+ if (music_url.find("http://") == 0)
+ {
+ music_url_no_http = music_url.substr(7, music_url.size() - 7);
+ }
+ //
LLSD streamlist = gSavedSettings.getLLSD("FSStreamList");
LLSD streamlist_new;
@@ -289,10 +320,13 @@ void LLPanelLandAudio::onBtnStreamDelete()
for (LLSD::array_const_iterator it = streamlist["audio"].beginArray(); it != streamlist["audio"].endArray(); ++it)
{
std::string current_url = (*it).asString();
- if (current_url != music_url)
+ // FIRE-29157 - Stream can't be deleted if onCommitAny() prepended "http://" to the URL since it doesn't match in the list.
+ //if (current_url != music_url)
+ if (current_url != music_url && !(current_url.find("://") == std::string::npos && current_url == music_url_no_http))
{
streamlist_new["audio"].append(current_url);
}
+ //
}
gSavedSettings.setLLSD("FSStreamList", streamlist_new);
diff --git a/indra/newview/llpanellandaudio.h b/indra/newview/llpanellandaudio.h
index b4673467c0..54a636c88e 100644
--- a/indra/newview/llpanellandaudio.h
+++ b/indra/newview/llpanellandaudio.h
@@ -70,6 +70,10 @@ private:
LLCheckBoxCtrl* mCheckAVSoundGroup;
LLSafeHandle& mParcel;
+
+ // FIRE-29157 - Remove invalid URLs that were rejected by the server
+ std::string mLastSetURL;
+ //
};
#endif