aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra
diff options
context:
space:
mode:
authorJacek Antonelli2011-04-01 23:39:04 -0500
committerJacek Antonelli2011-04-01 23:39:04 -0500
commit56bf482f921f78fa06818267e10b82807ee79bbc (patch)
treeaf1f4a40044a35752baa339ec046effe8621988c /linden/indra
parentMerge remote-tracking branch 'thickbrick/exp' into exp (diff)
parentMore #838: fix an errounous deletion 1235da40f8 (diff)
downloadmeta-impy-56bf482f921f78fa06818267e10b82807ee79bbc.zip
meta-impy-56bf482f921f78fa06818267e10b82807ee79bbc.tar.gz
meta-impy-56bf482f921f78fa06818267e10b82807ee79bbc.tar.bz2
meta-impy-56bf482f921f78fa06818267e10b82807ee79bbc.tar.xz
Merge remote-tracking branch 'thickbrick/exp' into exp
Conflicts: linden/indra/newview/llpanelaudioprefs.cpp linden/indra/newview/llpanelaudioprefs.h linden/indra/newview/skins/default/xui/en-us/panel_preferences_audio.xml
Diffstat (limited to 'linden/indra')
-rw-r--r--linden/indra/llinventory/llparcel.cpp12
-rw-r--r--linden/indra/llinventory/llparcel.h6
-rw-r--r--linden/indra/newview/app_settings/settings.xml11
-rw-r--r--linden/indra/newview/installers/windows/README.txt40
-rw-r--r--linden/indra/newview/llfloaterpreference.cpp1
-rw-r--r--linden/indra/newview/llmediaremotectrl.cpp2
-rw-r--r--linden/indra/newview/llpanelaudioprefs.cpp19
-rw-r--r--linden/indra/newview/llpanelaudioprefs.h4
-rw-r--r--linden/indra/newview/llpanellandaudio.cpp8
-rw-r--r--linden/indra/newview/llpanellandaudio.h1
-rw-r--r--linden/indra/newview/llpanellandmedia.cpp38
-rw-r--r--linden/indra/newview/llviewerparcelmedia.cpp273
-rw-r--r--linden/indra/newview/llviewerparcelmedia.h40
-rw-r--r--linden/indra/newview/llworldmap.cpp4
-rw-r--r--linden/indra/newview/llworldmapview.cpp2
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_about_land.xml44
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_media_filter.xml63
-rwxr-xr-xlinden/indra/newview/skins/default/xui/en-us/mime_types_linux.xml11
-rwxr-xr-xlinden/indra/newview/skins/default/xui/en-us/mime_types_mac.xml11
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/mime_types_windows.xml15
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/notifications.xml8
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/panel_preferences_audio.xml15
-rw-r--r--linden/indra/newview/slfloatermediafilter.cpp230
-rw-r--r--linden/indra/newview/slfloatermediafilter.h9
24 files changed, 599 insertions, 268 deletions
diff --git a/linden/indra/llinventory/llparcel.cpp b/linden/indra/llinventory/llparcel.cpp
index 39605eb..4cbb83a 100644
--- a/linden/indra/llinventory/llparcel.cpp
+++ b/linden/indra/llinventory/llparcel.cpp
@@ -195,8 +195,6 @@ void LLParcel::init(const LLUUID &owner_id,
195 mMediaID.setNull(); 195 mMediaID.setNull();
196 mMediaAutoScale = 0; 196 mMediaAutoScale = 0;
197 mMediaLoop = TRUE; 197 mMediaLoop = TRUE;
198 mObscureMedia = 1;
199 mObscureMusic = 1;
200 mMediaWidth = 0; 198 mMediaWidth = 0;
201 mMediaHeight = 0; 199 mMediaHeight = 0;
202 setMediaCurrentURL(LLStringUtil::null); 200 setMediaCurrentURL(LLStringUtil::null);
@@ -691,8 +689,8 @@ void LLParcel::packMessage(LLSD& msg)
691 msg["auto_scale"] = getMediaAutoScale(); 689 msg["auto_scale"] = getMediaAutoScale();
692 msg["media_loop"] = getMediaLoop(); 690 msg["media_loop"] = getMediaLoop();
693 msg["media_current_url"] = getMediaCurrentURL(); 691 msg["media_current_url"] = getMediaCurrentURL();
694 msg["obscure_media"] = getObscureMedia(); 692 msg["obscure_media"] = FALSE; // OBSOLETE - no longer used
695 msg["obscure_music"] = getObscureMusic(); 693 msg["obscure_music"] = FALSE; // OBSOLETE - no longer used
696 msg["media_id"] = getMediaID(); 694 msg["media_id"] = getMediaID();
697 msg["media_allow_navigate"] = getMediaAllowNavigate(); 695 msg["media_allow_navigate"] = getMediaAllowNavigate();
698 msg["media_prevent_camera_zoom"] = getMediaPreventCameraZoom(); 696 msg["media_prevent_camera_zoom"] = getMediaPreventCameraZoom();
@@ -757,8 +755,6 @@ void LLParcel::unpackMessage(LLMessageSystem* msg)
757 msg->getS32("MediaData", "MediaWidth", mMediaWidth); 755 msg->getS32("MediaData", "MediaWidth", mMediaWidth);
758 msg->getS32("MediaData", "MediaHeight", mMediaHeight); 756 msg->getS32("MediaData", "MediaHeight", mMediaHeight);
759 msg->getU8 ( "MediaData", "MediaLoop", mMediaLoop ); 757 msg->getU8 ( "MediaData", "MediaLoop", mMediaLoop );
760 msg->getU8 ( "MediaData", "ObscureMedia", mObscureMedia );
761 msg->getU8 ( "MediaData", "ObscureMusic", mObscureMusic );
762 } 758 }
763 else 759 else
764 { 760 {
@@ -766,8 +762,6 @@ void LLParcel::unpackMessage(LLMessageSystem* msg)
766 // thats what we want -- AW 762 // thats what we want -- AW
767 setMediaDesc(std::string("No Description available without Server Upgrade")); 763 setMediaDesc(std::string("No Description available without Server Upgrade"));
768 mMediaLoop = true; 764 mMediaLoop = true;
769 mObscureMedia = true;
770 mObscureMusic = true;
771 } 765 }
772 766
773 if(msg->getNumberOfBlocks("MediaLinkSharing") > 0) 767 if(msg->getNumberOfBlocks("MediaLinkSharing") > 0)
@@ -1233,8 +1227,6 @@ void LLParcel::clearParcel()
1233 setMediaDesc(LLStringUtil::null); 1227 setMediaDesc(LLStringUtil::null);
1234 setMediaAutoScale(0); 1228 setMediaAutoScale(0);
1235 setMediaLoop(TRUE); 1229 setMediaLoop(TRUE);
1236 mObscureMedia = 1;
1237 mObscureMusic = 1;
1238 mMediaWidth = 0; 1230 mMediaWidth = 0;
1239 mMediaHeight = 0; 1231 mMediaHeight = 0;
1240 setMediaCurrentURL(LLStringUtil::null); 1232 setMediaCurrentURL(LLStringUtil::null);
diff --git a/linden/indra/llinventory/llparcel.h b/linden/indra/llinventory/llparcel.h
index f102ec4..52f97de 100644
--- a/linden/indra/llinventory/llparcel.h
+++ b/linden/indra/llinventory/llparcel.h
@@ -244,8 +244,6 @@ public:
244 void setMediaID(const LLUUID& id) { mMediaID = id; } 244 void setMediaID(const LLUUID& id) { mMediaID = id; }
245 void setMediaAutoScale ( U8 flagIn ) { mMediaAutoScale = flagIn; } 245 void setMediaAutoScale ( U8 flagIn ) { mMediaAutoScale = flagIn; }
246 void setMediaLoop (U8 loop) { mMediaLoop = loop; } 246 void setMediaLoop (U8 loop) { mMediaLoop = loop; }
247 void setObscureMedia( U8 flagIn ) { mObscureMedia = flagIn; }
248 void setObscureMusic( U8 flagIn ) { mObscureMusic = flagIn; }
249 void setMediaWidth(S32 width); 247 void setMediaWidth(S32 width);
250 void setMediaHeight(S32 height); 248 void setMediaHeight(S32 height);
251 void setMediaCurrentURL(const std::string& url); 249 void setMediaCurrentURL(const std::string& url);
@@ -352,8 +350,6 @@ public:
352 U8 getMediaAutoScale() const { return mMediaAutoScale; } 350 U8 getMediaAutoScale() const { return mMediaAutoScale; }
353 U8 getMediaLoop() const { return mMediaLoop; } 351 U8 getMediaLoop() const { return mMediaLoop; }
354 const std::string& getMediaCurrentURL() const { return mMediaCurrentURL; } 352 const std::string& getMediaCurrentURL() const { return mMediaCurrentURL; }
355 U8 getObscureMedia() const { return mObscureMedia; }
356 U8 getObscureMusic() const { return mObscureMusic; }
357 U8 getMediaURLFilterEnable() const { return mMediaURLFilterEnable; } 353 U8 getMediaURLFilterEnable() const { return mMediaURLFilterEnable; }
358 LLSD getMediaURLFilterList() const { return mMediaURLFilterList; } 354 LLSD getMediaURLFilterList() const { return mMediaURLFilterList; }
359 U8 getMediaAllowNavigate() const { return mMediaAllowNavigate; } 355 U8 getMediaAllowNavigate() const { return mMediaAllowNavigate; }
@@ -645,8 +641,6 @@ protected:
645 U8 mMediaAutoScale; 641 U8 mMediaAutoScale;
646 U8 mMediaLoop; 642 U8 mMediaLoop;
647 std::string mMediaCurrentURL; 643 std::string mMediaCurrentURL;
648 U8 mObscureMedia;
649 U8 mObscureMusic;
650 LLUUID mMediaID; 644 LLUUID mMediaID;
651 U8 mMediaURLFilterEnable; 645 U8 mMediaURLFilterEnable;
652 LLSD mMediaURLFilterList; 646 LLSD mMediaURLFilterList;
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml
index 315670c..ad9cfea 100644
--- a/linden/indra/newview/app_settings/settings.xml
+++ b/linden/indra/newview/app_settings/settings.xml
@@ -8063,6 +8063,17 @@
8063 <integer>100</integer> 8063 <integer>100</integer>
8064 </array> 8064 </array>
8065 </map> 8065 </map>
8066 <key>MediaFilterOnlyRemoteCommands</key>
8067 <map>
8068 <key>Comment</key>
8069 <string>Whether Media Filter should only filter actions initiated remotely</string>
8070 <key>Persist</key>
8071 <integer>1</integer>
8072 <key>Type</key>
8073 <string>Boolean</string>
8074 <key>Value</key>
8075 <integer>1</integer>
8076 </map>
8066 <key>MediaOnAPrimUI</key> 8077 <key>MediaOnAPrimUI</key>
8067 <map> 8078 <map>
8068 <key>Comment</key> 8079 <key>Comment</key>
diff --git a/linden/indra/newview/installers/windows/README.txt b/linden/indra/newview/installers/windows/README.txt
deleted file mode 100644
index c29e858..0000000
--- a/linden/indra/newview/installers/windows/README.txt
+++ /dev/null
@@ -1,40 +0,0 @@
1
2 ABOUT IMPRUDENCE
3
4 Imprudence is an open source metaverse viewer project based on
5 the Second Life Viewer source.
6
7 The goal of Imprudence is to greatly improve the usability of
8 the Viewer through community involvement, thoughtful design,
9 modern development methods, and a pro-change atmosphere.
10
11 For more information about the rationale, goals, and methods
12 of the Imprudence project, please see MANIFESTO.txt.
13
14 If you would like to get involved with the Imprudence project,
15 please see CONTRIBUTE.txt. There are many ways you can help,
16 no matter your skills or the amount of time you can dedicate.
17
18
19 Imprudence is online at kokuaviewer.org
20
21
22 The latest source code for the Imprudence Viewer is always
23 available at:
24
25 http://github.com/imprudence/imprudence
26
27
28 LICENSE
29
30 All code is licensed under the terms of the GNU General Public
31 License version 2.0 (plus a special exception).
32
33 See linden/LICENSE-source.txt for details.
34
35
36 DISCLAIMERS AND NOTICES
37
38 Second Life is a registered trademark of Linden Research, Inc.
39
40 Imprudence is in no way affiliated with Linden Research, Inc.
diff --git a/linden/indra/newview/llfloaterpreference.cpp b/linden/indra/newview/llfloaterpreference.cpp
index d312cb6..c99d75d 100644
--- a/linden/indra/newview/llfloaterpreference.cpp
+++ b/linden/indra/newview/llfloaterpreference.cpp
@@ -365,6 +365,7 @@ void LLPreferenceCore::setPersonalInfo(const std::string& visibility, bool im_vi
365void LLPreferenceCore::updateIsLoggedIn(bool enable) 365void LLPreferenceCore::updateIsLoggedIn(bool enable)
366{ 366{
367 mPrefsIM->preparePerAccountPrefs(enable); 367 mPrefsIM->preparePerAccountPrefs(enable);
368 mAudioPanel->updateIsLoggedIn(enable);
368} 369}
369 370
370void LLPreferenceCore::refreshEnabledGraphics() 371void LLPreferenceCore::refreshEnabledGraphics()
diff --git a/linden/indra/newview/llmediaremotectrl.cpp b/linden/indra/newview/llmediaremotectrl.cpp
index 8186293..2f6dbdf 100644
--- a/linden/indra/newview/llmediaremotectrl.cpp
+++ b/linden/indra/newview/llmediaremotectrl.cpp
@@ -172,7 +172,7 @@ void LLMediaRemoteCtrl::enableMediaButtons()
172 { 172 {
173 // Set the tooltip 173 // Set the tooltip
174 // Put this text into xui file 174 // Put this text into xui file
175 media_url = parcel->getObscureMedia() ? mControls->getString("media_hidden_label") : parcel->getMediaURL(); 175 media_url = parcel->getMediaURL();
176 media_type = parcel->getMediaType(); 176 media_type = parcel->getMediaType();
177 177
178 play_media_enabled = true; 178 play_media_enabled = true;
diff --git a/linden/indra/newview/llpanelaudioprefs.cpp b/linden/indra/newview/llpanelaudioprefs.cpp
index f1a8af5..25e5043 100644
--- a/linden/indra/newview/llpanelaudioprefs.cpp
+++ b/linden/indra/newview/llpanelaudioprefs.cpp
@@ -55,12 +55,14 @@
55#include "llslider.h" 55#include "llslider.h"
56#include "llsliderctrl.h" 56#include "llsliderctrl.h"
57#include "llspinctrl.h" 57#include "llspinctrl.h"
58#include "llstartup.h"
58#include "lltextbox.h" 59#include "lltextbox.h"
59#include "llui.h" 60#include "llui.h"
60#include "llviewerparcelmgr.h" 61#include "llviewerparcelmgr.h"
61#include "lluictrlfactory.h" 62#include "lluictrlfactory.h"
62#include "llviewerwindow.h" 63#include "llviewerwindow.h"
63#include "llviewercontrol.h" 64#include "llviewercontrol.h"
65#include "slfloatermediafilter.h"
64 66
65#include "hippogridmanager.h" 67#include "hippogridmanager.h"
66 68
@@ -92,6 +94,8 @@ BOOL LLPanelAudioPrefs::postBuild()
92 refreshValues(); // initialize member data from saved settings 94 refreshValues(); // initialize member data from saved settings
93 childSetLabelArg("L$ Change Threshold", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); 95 childSetLabelArg("L$ Change Threshold", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());
94 childSetValue("mute_wind_check", !gSavedSettings.getBOOL("MuteWind")); 96 childSetValue("mute_wind_check", !gSavedSettings.getBOOL("MuteWind"));
97 childSetAction("show_media_filter", onShowMediaFilter, this);
98 updateIsLoggedIn(LLStartUp::isLoggedIn());
95 99
96 return TRUE; 100 return TRUE;
97} 101}
@@ -113,7 +117,7 @@ void LLPanelAudioPrefs::refreshValues()
113 mPreviousStreamingMusic = gSavedSettings.getBOOL("AudioStreamingMusic"); 117 mPreviousStreamingMusic = gSavedSettings.getBOOL("AudioStreamingMusic");
114 mPreviousStreamingVideo = gSavedSettings.getBOOL("AudioStreamingVideo"); 118 mPreviousStreamingVideo = gSavedSettings.getBOOL("AudioStreamingVideo");
115 mPreviousHelperWidget = gSavedSettings.getBOOL("MediaOnAPrimUI"); 119 mPreviousHelperWidget = gSavedSettings.getBOOL("MediaOnAPrimUI");
116 120 mPreviousEnableMediaFilter = gSavedSettings.getBOOL("MediaEnableFilter");
117 mPreviousMuteAudio = gSavedSettings.getBOOL("MuteAudio"); 121 mPreviousMuteAudio = gSavedSettings.getBOOL("MuteAudio");
118 mPreviousMuteWhenMinimized = gSavedSettings.getBOOL("MuteWhenMinimized"); 122 mPreviousMuteWhenMinimized = gSavedSettings.getBOOL("MuteWhenMinimized");
119} 123}
@@ -142,7 +146,18 @@ void LLPanelAudioPrefs::cancel()
142 gSavedSettings.setBOOL("AudioStreamingMusic", mPreviousStreamingMusic ); 146 gSavedSettings.setBOOL("AudioStreamingMusic", mPreviousStreamingMusic );
143 gSavedSettings.setBOOL("AudioStreamingVideo", mPreviousStreamingVideo ); 147 gSavedSettings.setBOOL("AudioStreamingVideo", mPreviousStreamingVideo );
144 gSavedSettings.setBOOL("MediaOnAPrimUI", mPreviousHelperWidget ); 148 gSavedSettings.setBOOL("MediaOnAPrimUI", mPreviousHelperWidget );
145 149 gSavedSettings.setBOOL("MediaEnableFilter", mPreviousEnableMediaFilter );
146 gSavedSettings.setBOOL("MuteAudio", mPreviousMuteAudio ); 150 gSavedSettings.setBOOL("MuteAudio", mPreviousMuteAudio );
147 gSavedSettings.setBOOL("MuteWhenMinimized", mPreviousMuteWhenMinimized ); 151 gSavedSettings.setBOOL("MuteWhenMinimized", mPreviousMuteWhenMinimized );
148} 152}
153
154//static
155void LLPanelAudioPrefs::onShowMediaFilter(void* data)
156{
157 SLFloaterMediaFilter::toggleInstance();
158}
159
160void LLPanelAudioPrefs::updateIsLoggedIn(const bool enable)
161{
162 childSetEnabled("show_media_filter", enable);
163}
diff --git a/linden/indra/newview/llpanelaudioprefs.h b/linden/indra/newview/llpanelaudioprefs.h
index 56982b8..a47a83e 100644
--- a/linden/indra/newview/llpanelaudioprefs.h
+++ b/linden/indra/newview/llpanelaudioprefs.h
@@ -54,6 +54,9 @@ public:
54 virtual BOOL postBuild(); 54 virtual BOOL postBuild();
55 55
56 static void* createVolumePanel(void* data); 56 static void* createVolumePanel(void* data);
57 static void onShowMediaFilter(void* data);
58
59 void updateIsLoggedIn(const bool);
57 60
58private: 61private:
59 void refreshValues(); 62 void refreshValues();
@@ -76,6 +79,7 @@ private:
76 BOOL mPreviousStreamingMusic; 79 BOOL mPreviousStreamingMusic;
77 BOOL mPreviousStreamingVideo; 80 BOOL mPreviousStreamingVideo;
78 BOOL mPreviousHelperWidget; 81 BOOL mPreviousHelperWidget;
82 BOOL mPreviousEnableMediaFilter;
79 BOOL mPreviousMuteAudio; 83 BOOL mPreviousMuteAudio;
80 BOOL mPreviousMuteWhenMinimized; 84 BOOL mPreviousMuteWhenMinimized;
81}; 85};
diff --git a/linden/indra/newview/llpanellandaudio.cpp b/linden/indra/newview/llpanellandaudio.cpp
index 0247009..8d902b6 100644
--- a/linden/indra/newview/llpanellandaudio.cpp
+++ b/linden/indra/newview/llpanellandaudio.cpp
@@ -91,9 +91,6 @@ BOOL LLPanelLandAudio::postBuild()
91 mMusicURLEdit = getChild<LLLineEditor>("music_url"); 91 mMusicURLEdit = getChild<LLLineEditor>("music_url");
92 childSetCommitCallback("music_url", onCommitAny, this); 92 childSetCommitCallback("music_url", onCommitAny, this);
93 93
94 mMusicUrlCheck = getChild<LLCheckBoxCtrl>("hide_music_url");
95 childSetCommitCallback("hide_music_url", onCommitAny, this);
96
97 return TRUE; 94 return TRUE;
98} 95}
99 96
@@ -117,9 +114,6 @@ void LLPanelLandAudio::refresh()
117 mMusicURLEdit->setText(parcel->getMusicURL()); 114 mMusicURLEdit->setText(parcel->getMusicURL());
118 mMusicURLEdit->setEnabled( can_change_media ); 115 mMusicURLEdit->setEnabled( can_change_media );
119 116
120 mMusicUrlCheck->set( parcel->getObscureMusic() );
121 mMusicUrlCheck->setEnabled( can_change_media );
122
123 mCheckSoundLocal->set( parcel->getSoundLocal() ); 117 mCheckSoundLocal->set( parcel->getSoundLocal() );
124 mCheckSoundLocal->setEnabled( can_change_media ); 118 mCheckSoundLocal->setEnabled( can_change_media );
125 119
@@ -154,7 +148,6 @@ void LLPanelLandAudio::onCommitAny(LLUICtrl*, void *userdata)
154 BOOL sound_local = self->mCheckSoundLocal->get(); 148 BOOL sound_local = self->mCheckSoundLocal->get();
155 int voice_setting = self->mRadioVoiceChat->getSelectedIndex(); 149 int voice_setting = self->mRadioVoiceChat->getSelectedIndex();
156 std::string music_url = self->mMusicURLEdit->getText(); 150 std::string music_url = self->mMusicURLEdit->getText();
157 U8 obscure_music = self->mMusicUrlCheck->get();
158 151
159 152
160 BOOL voice_enabled; 153 BOOL voice_enabled;
@@ -185,7 +178,6 @@ void LLPanelLandAudio::onCommitAny(LLUICtrl*, void *userdata)
185 parcel->setParcelFlag(PF_USE_ESTATE_VOICE_CHAN, voice_estate_chan); 178 parcel->setParcelFlag(PF_USE_ESTATE_VOICE_CHAN, voice_estate_chan);
186 parcel->setParcelFlag(PF_SOUND_LOCAL, sound_local); 179 parcel->setParcelFlag(PF_SOUND_LOCAL, sound_local);
187 parcel->setMusicURL(music_url); 180 parcel->setMusicURL(music_url);
188 parcel->setObscureMusic(obscure_music);
189 181
190 // Send current parcel data upstream to server 182 // Send current parcel data upstream to server
191 LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); 183 LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel );
diff --git a/linden/indra/newview/llpanellandaudio.h b/linden/indra/newview/llpanellandaudio.h
index 3d5d633..82e27f6 100644
--- a/linden/indra/newview/llpanellandaudio.h
+++ b/linden/indra/newview/llpanellandaudio.h
@@ -55,7 +55,6 @@ private:
55 LLCheckBoxCtrl* mCheckSoundLocal; 55 LLCheckBoxCtrl* mCheckSoundLocal;
56 LLRadioGroup* mRadioVoiceChat; 56 LLRadioGroup* mRadioVoiceChat;
57 LLLineEditor* mMusicURLEdit; 57 LLLineEditor* mMusicURLEdit;
58 LLCheckBoxCtrl* mMusicUrlCheck;
59 58
60 LLSafeHandle<LLParcelSelection>& mParcel; 59 LLSafeHandle<LLParcelSelection>& mParcel;
61}; 60};
diff --git a/linden/indra/newview/llpanellandmedia.cpp b/linden/indra/newview/llpanellandmedia.cpp
index b7df164..8a0be86 100644
--- a/linden/indra/newview/llpanellandmedia.cpp
+++ b/linden/indra/newview/llpanellandmedia.cpp
@@ -80,9 +80,7 @@ LLPanelLandMedia::LLPanelLandMedia(LLParcelSelectionHandle& parcel)
80 mMediaSizeCtrlLabel(NULL), 80 mMediaSizeCtrlLabel(NULL),
81 mMediaTextureCtrl(NULL), 81 mMediaTextureCtrl(NULL),
82 mMediaAutoScaleCheck(NULL), 82 mMediaAutoScaleCheck(NULL),
83 mMediaLoopCheck(NULL), 83 mMediaLoopCheck(NULL)
84 mMediaUrlCheck(NULL),
85 mMusicUrlCheck(NULL)
86{ 84{
87} 85}
88 86
@@ -132,12 +130,6 @@ BOOL LLPanelLandMedia::postBuild()
132 mMediaLoopCheck = getChild<LLCheckBoxCtrl>("media_loop"); 130 mMediaLoopCheck = getChild<LLCheckBoxCtrl>("media_loop");
133 childSetCommitCallback("media_loop", onCommitAny, this); 131 childSetCommitCallback("media_loop", onCommitAny, this);
134 132
135 mMediaUrlCheck = getChild<LLCheckBoxCtrl>("hide_media_url");
136 childSetCommitCallback("hide_media_url", onCommitAny, this);
137
138 mMusicUrlCheck = getChild<LLCheckBoxCtrl>("hide_music_url");
139 childSetCommitCallback("hide_music_url", onCommitAny, this);
140
141 mMediaURLEdit = getChild<LLLineEditor>("media_url"); 133 mMediaURLEdit = getChild<LLLineEditor>("media_url");
142 childSetCommitCallback("media_url", onCommitAny, this); 134 childSetCommitCallback("media_url", onCommitAny, this);
143 135
@@ -243,30 +235,6 @@ void LLPanelLandMedia::refresh()
243 mMediaTypeCombo->setEnabled( can_change_media ); 235 mMediaTypeCombo->setEnabled( can_change_media );
244 childSetText("mime_type", mime_type); 236 childSetText("mime_type", mime_type);
245 237
246 mMediaUrlCheck->set( parcel->getObscureMedia() );
247 mMediaUrlCheck->setEnabled( can_change_media );
248
249 mMusicUrlCheck->set( parcel->getObscureMusic() );
250 mMusicUrlCheck->setEnabled( can_change_media );
251
252 // don't display urls if you're not able to change it
253 // much requested change in forums so people can't 'steal' urls
254 // NOTE: bug#2009 means this is still vunerable - however, bug
255 // should be closed since this bug opens up major security issues elsewhere.
256 bool obscure_media = ! can_change_media && parcel->getObscureMedia();
257 bool obscure_music = ! can_change_media && parcel->getObscureMusic();
258
259 // Special code to disable asterixes for html type
260 if(mime_type == "text/html")
261 {
262 obscure_media = false;
263 mMediaUrlCheck->set( 0 );
264 mMediaUrlCheck->setEnabled( false );
265 }
266
267 mMusicURLEdit->setDrawAsterixes( obscure_music );
268 mMediaURLEdit->setDrawAsterixes( obscure_media );
269
270 mMediaAutoScaleCheck->set( parcel->getMediaAutoScale () ); 238 mMediaAutoScaleCheck->set( parcel->getMediaAutoScale () );
271 mMediaAutoScaleCheck->setEnabled ( can_change_media ); 239 mMediaAutoScaleCheck->setEnabled ( can_change_media );
272 240
@@ -413,8 +381,6 @@ void LLPanelLandMedia::onCommitAny(LLUICtrl*, void *userdata)
413 std::string mime_type = self->childGetText("mime_type"); 381 std::string mime_type = self->childGetText("mime_type");
414 U8 media_auto_scale = self->mMediaAutoScaleCheck->get(); 382 U8 media_auto_scale = self->mMediaAutoScaleCheck->get();
415 U8 media_loop = self->mMediaLoopCheck->get(); 383 U8 media_loop = self->mMediaLoopCheck->get();
416 U8 obscure_media = self->mMediaUrlCheck->get();
417 U8 obscure_music = self->mMusicUrlCheck->get();
418 S32 media_width = (S32)self->mMediaWidthCtrl->get(); 384 S32 media_width = (S32)self->mMediaWidthCtrl->get();
419 S32 media_height = (S32)self->mMediaHeightCtrl->get(); 385 S32 media_height = (S32)self->mMediaHeightCtrl->get();
420 LLUUID media_id = self->mMediaTextureCtrl->getImageAssetID(); 386 LLUUID media_id = self->mMediaTextureCtrl->getImageAssetID();
@@ -441,8 +407,6 @@ void LLPanelLandMedia::onCommitAny(LLUICtrl*, void *userdata)
441 parcel->setMediaID(media_id); 407 parcel->setMediaID(media_id);
442 parcel->setMediaAutoScale ( media_auto_scale ); 408 parcel->setMediaAutoScale ( media_auto_scale );
443 parcel->setMediaLoop ( media_loop ); 409 parcel->setMediaLoop ( media_loop );
444 parcel->setObscureMedia( obscure_media );
445 parcel->setObscureMusic( obscure_music );
446 410
447 // Send current parcel data upstream to server 411 // Send current parcel data upstream to server
448 LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); 412 LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel );
diff --git a/linden/indra/newview/llviewerparcelmedia.cpp b/linden/indra/newview/llviewerparcelmedia.cpp
index a5d97f2..386a86e 100644
--- a/linden/indra/newview/llviewerparcelmedia.cpp
+++ b/linden/indra/newview/llviewerparcelmedia.cpp
@@ -49,6 +49,7 @@
49#include "llpluginclassmedia.h" 49#include "llpluginclassmedia.h"
50#include "llnotify.h" 50#include "llnotify.h"
51#include "llsdserialize.h" 51#include "llsdserialize.h"
52#include "llmemory.h"
52 53
53#include "lloverlaybar.h" 54#include "lloverlaybar.h"
54#include "slfloatermediafilter.h" 55#include "slfloatermediafilter.h"
@@ -64,6 +65,7 @@ LLSD LLViewerParcelMedia::sMediaFilterList;
64std::set<std::string> LLViewerParcelMedia::sMediaQueries; 65std::set<std::string> LLViewerParcelMedia::sMediaQueries;
65std::set<std::string> LLViewerParcelMedia::sAllowedMedia; 66std::set<std::string> LLViewerParcelMedia::sAllowedMedia;
66std::set<std::string> LLViewerParcelMedia::sDeniedMedia; 67std::set<std::string> LLViewerParcelMedia::sDeniedMedia;
68LLPointer<LLViewerParcelMediaInfo> LLViewerParcelMedia::sSavedMediaInfo;
67 69
68// Local functions 70// Local functions
69bool callback_play_media(const LLSD& notification, const LLSD& response, LLParcel* parcel); 71bool callback_play_media(const LLSD& notification, const LLSD& response, LLParcel* parcel);
@@ -186,7 +188,7 @@ void LLViewerParcelMedia::update(LLParcel* parcel)
186} 188}
187 189
188// static 190// static
189void LLViewerParcelMedia::play(LLParcel* parcel, bool filter) 191void LLViewerParcelMedia::play(LLParcel* parcel, bool filter, const ECommandOrigin origin)
190{ 192{
191 lldebugs << "LLViewerParcelMedia::play" << llendl; 193 lldebugs << "LLViewerParcelMedia::play" << llendl;
192 194
@@ -198,12 +200,13 @@ void LLViewerParcelMedia::play(LLParcel* parcel, bool filter)
198 std::string media_url = parcel->getMediaURL(); 200 std::string media_url = parcel->getMediaURL();
199 LLStringUtil::trim(media_url); 201 LLStringUtil::trim(media_url);
200 202
201 if (!media_url.empty() && gSavedSettings.getBOOL("MediaEnableFilter") && (filter || !allowedMedia(media_url))) 203 if (!media_url.empty() && gSavedSettings.getBOOL("MediaEnableFilter") && filter
204 && (!allowedMedia(media_url) || origin == COMMAND_ORIGIN_REMOTE))
202 { 205 {
203 // If filtering is needed or in case media_url just changed 206 // If filtering is needed or in case media_url just changed
204 // to something we did not yet approve. 207 // to something we did not yet approve.
205 LLViewerParcelMediaAutoPlay::playStarted(); 208 LLViewerParcelMediaAutoPlay::playStarted();
206 filterMedia(parcel, 0); 209 filterMedia(parcel, 0, origin);
207 return; 210 return;
208 } 211 }
209 212
@@ -384,7 +387,7 @@ void LLViewerParcelMedia::processParcelMediaCommandMessage( LLMessageSystem *msg
384 else 387 else
385 { 388 {
386 LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); 389 LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
387 play(parcel); 390 play(parcel, true, COMMAND_ORIGIN_REMOTE);
388 } 391 }
389 } 392 }
390 else 393 else
@@ -400,7 +403,7 @@ void LLViewerParcelMedia::processParcelMediaCommandMessage( LLMessageSystem *msg
400 if(sMediaImpl.isNull()) 403 if(sMediaImpl.isNull())
401 { 404 {
402 LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); 405 LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
403 play(parcel); 406 play(parcel, true, COMMAND_ORIGIN_REMOTE);
404 } 407 }
405 seek(time); 408 seek(time);
406 } 409 }
@@ -437,33 +440,38 @@ void LLViewerParcelMedia::processParcelMediaUpdate( LLMessageSystem *msg, void *
437 } 440 }
438 441
439 LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); 442 LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
440 BOOL same = FALSE;
441 if (parcel) 443 if (parcel)
442 { 444 {
443 same = ((parcel->getMediaURL() == media_url) && 445 LLViewerParcelMediaInfo* new_info = new LLViewerParcelMediaInfo(media_url, media_type, media_id, media_width, media_height, media_auto_scale, media_loop);
444 (parcel->getMediaType() == media_type) && 446 LLViewerParcelMediaInfo* current_info = new LLViewerParcelMediaInfo(parcel);
445 (parcel->getMediaID() == media_id) && 447 if (new_info != current_info)
446 (parcel->getMediaWidth() == media_width) &&
447 (parcel->getMediaHeight() == media_height) &&
448 (parcel->getMediaAutoScale() == media_auto_scale) &&
449 (parcel->getMediaLoop() == media_loop));
450
451 if (!same)
452 { 448 {
449 if (!sSavedMediaInfo || (sSavedMediaInfo && !sSavedMediaInfo->sameParcel(parcel)))
450 {
451 // only save if no previously saved media info, because
452 // we want to remeber the original parcel media info.
453 sSavedMediaInfo = current_info;
454 }
453 // temporarily store these new values in the parcel 455 // temporarily store these new values in the parcel
454 parcel->setMediaURL(media_url); 456 new_info->applyToParcel(parcel);
455 parcel->setMediaType(media_type);
456 parcel->setMediaID(media_id);
457 parcel->setMediaWidth(media_width);
458 parcel->setMediaHeight(media_height);
459 parcel->setMediaAutoScale(media_auto_scale);
460 parcel->setMediaLoop(media_loop);
461 457
462 play(parcel); 458 play(parcel, true, COMMAND_ORIGIN_REMOTE);
463 } 459 }
464 460
465 } 461 }
466} 462}
463
464//static
465void LLViewerParcelMedia::undoParcelMediaUpdate()
466{
467 LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
468 if (sSavedMediaInfo.notNull() && parcel)
469 {
470 sSavedMediaInfo->applyToParcel(parcel);
471 }
472 sSavedMediaInfo = NULL;
473}
474
467// Static 475// Static
468///////////////////////////////////////////////////////////////////////////////////////// 476/////////////////////////////////////////////////////////////////////////////////////////
469void LLViewerParcelMedia::sendMediaNavigateMessage(const std::string& url) 477void LLViewerParcelMedia::sendMediaNavigateMessage(const std::string& url)
@@ -619,7 +627,7 @@ void LLViewerParcelMedia::playStreamingMusic(LLParcel* parcel, bool filter)
619 { 627 {
620 // If filtering is needed or in case music_url just changed 628 // If filtering is needed or in case music_url just changed
621 // to something we did not yet approve. 629 // to something we did not yet approve.
622 filterMedia(parcel, 1); 630 filterMedia(parcel, 1, COMMAND_ORIGIN_LOCAL);
623 } 631 }
624 else if (gAudioStream) 632 else if (gAudioStream)
625 { 633 {
@@ -649,13 +657,18 @@ bool LLViewerParcelMedia::allowedMedia(std::string media_url)
649{ 657{
650 LLStringUtil::trim(media_url); 658 LLStringUtil::trim(media_url);
651 std::string domain = extractDomain(media_url); 659 std::string domain = extractDomain(media_url);
660 LLHost host;
661 host.setHostByName(domain);
662 std::string ip = host.getIPString();
652 if (sAllowedMedia.count(domain)) 663 if (sAllowedMedia.count(domain))
653 { 664 {
654 return true; 665 return true;
655 } 666 }
667 std::string server;
656 for (S32 i = 0; i < (S32)sMediaFilterList.size(); i++) 668 for (S32 i = 0; i < (S32)sMediaFilterList.size(); i++)
657 { 669 {
658 if (sMediaFilterList[i]["domain"].asString() == domain) 670 server = sMediaFilterList[i]["domain"].asString();
671 if (server == domain || server == ip)
659 { 672 {
660 if (sMediaFilterList[i]["action"].asString() == "allow") 673 if (sMediaFilterList[i]["action"].asString() == "allow")
661 { 674 {
@@ -670,12 +683,13 @@ bool LLViewerParcelMedia::allowedMedia(std::string media_url)
670 return false; 683 return false;
671} 684}
672 685
673void LLViewerParcelMedia::filterMedia(LLParcel* parcel, U32 type) 686void LLViewerParcelMedia::filterMedia(LLParcel* parcel, U32 type, const ECommandOrigin origin)
674{ 687{
675 std::string media_action; 688 std::string media_action;
676 std::string media_url; 689 std::string media_url;
677 std::string domain; 690 std::string domain;
678 691 std::string ip;
692
679 if (parcel != LLViewerParcelMgr::getInstance()->getAgentParcel()) 693 if (parcel != LLViewerParcelMgr::getInstance()->getAgentParcel())
680 { 694 {
681 // The parcel just changed (may occur right out after a TP) 695 // The parcel just changed (may occur right out after a TP)
@@ -703,31 +717,51 @@ void LLViewerParcelMedia::filterMedia(LLParcel* parcel, U32 type)
703 return; 717 return;
704 } 718 }
705 719
720 LLHost host;
721 host.setHostByName(domain);
722 ip = host.getIPString();
723
706 if (sIsUserAction) 724 if (sIsUserAction)
707 { 725 {
708 // This was a user manual request to play this media, so give 726 // This was a user manual request to play this media, so give
709 // it another chance... 727 // it another chance...
710 sIsUserAction = false; 728 sIsUserAction = false;
729 bool dirty = false;
711 if (sDeniedMedia.count(domain)) 730 if (sDeniedMedia.count(domain))
712 { 731 {
713 sDeniedMedia.erase(domain); 732 sDeniedMedia.erase(domain);
733 dirty = true;
734 }
735 if (sDeniedMedia.count(ip))
736 {
737 sDeniedMedia.erase(ip);
738 dirty = true;
739 }
740 if (dirty)
741 {
714 SLFloaterMediaFilter::setDirty(); 742 SLFloaterMediaFilter::setDirty();
715 } 743 }
716 } 744 }
717 745
718 if (!sMediaFilterListLoaded || sDeniedMedia.count(domain)) 746 if (media_url.empty())
747 {
748 media_action == "allow";
749 }
750 else if (!sMediaFilterListLoaded || sDeniedMedia.count(domain) || sDeniedMedia.count(ip))
719 { 751 {
720 media_action = "ignore"; 752 media_action = "ignore";
721 } 753 }
722 else if (sAllowedMedia.count(domain)) 754 else if (sAllowedMedia.count(domain) || sAllowedMedia.count(ip))
723 { 755 {
724 media_action = "allow"; 756 media_action = "allow";
725 } 757 }
726 else 758 else
727 { 759 {
760 std::string server;
728 for (S32 i = 0; i < (S32)sMediaFilterList.size(); i++) 761 for (S32 i = 0; i < (S32)sMediaFilterList.size(); i++)
729 { 762 {
730 if (sMediaFilterList[i]["domain"].asString() == domain) 763 server = sMediaFilterList[i]["domain"].asString();
764 if (server == domain || server == ip)
731 { 765 {
732 media_action = sMediaFilterList[i]["action"].asString(); 766 media_action = sMediaFilterList[i]["action"].asString();
733 break; 767 break;
@@ -735,7 +769,7 @@ void LLViewerParcelMedia::filterMedia(LLParcel* parcel, U32 type)
735 } 769 }
736 } 770 }
737 771
738 if (media_action == "allow" || media_url.empty()) 772 if (media_action == "allow")
739 { 773 {
740 if (type == 0) 774 if (type == 0)
741 { 775 {
@@ -745,47 +779,76 @@ void LLViewerParcelMedia::filterMedia(LLParcel* parcel, U32 type)
745 { 779 {
746 playStreamingMusic(parcel, false); 780 playStreamingMusic(parcel, false);
747 } 781 }
782 return;
748 } 783 }
749 else if (media_action == "deny") 784 if (media_action == "ignore")
750 { 785 {
751 LLSD args; 786 if (type == 0)
752 args["DOMAIN"] = domain; 787 {
753 LLNotifications::instance().add("MediaBlocked", args); 788 undoParcelMediaUpdate();
754 if (type == 1) 789 }
790 else if (type == 1)
755 { 791 {
756 LLViewerParcelMedia::stopStreamingMusic(); 792 LLViewerParcelMedia::stopStreamingMusic();
757 } 793 }
758 // So to avoid other "blocked" messages later in the session 794 return;
759 // for this url should it be requested again by a script.
760 sDeniedMedia.insert(domain);
761 } 795 }
762 else if (media_action == "ignore") 796 // skip local-originating play commands, unless the url is blacklisted.
797 if (gSavedSettings.getBOOL("MediaFilterOnlyRemoteCommands")
798 && (origin != COMMAND_ORIGIN_REMOTE)
799 && (media_action != "ignore"))
763 { 800 {
764 if (type == 1) 801 sAllowedMedia.insert(domain);
802 SLFloaterMediaFilter::setDirty();
803 if (type == 0)
765 { 804 {
766 LLViewerParcelMedia::stopStreamingMusic(); 805 play(parcel, false);
767 } 806 }
807 else
808 {
809 playStreamingMusic(parcel, false);
810 }
811 return;
812 }
813
814 LLSD args;
815 if (ip != domain && domain.find('/') == std::string::npos)
816 {
817 args["DOMAIN"] = domain + " (" + ip + ")";
768 } 818 }
769 else 819 else
770 { 820 {
771 sMediaQueries.insert(domain);
772 LLSD args;
773 args["DOMAIN"] = domain; 821 args["DOMAIN"] = domain;
774 if (media_url.find('?') != std::string::npos) 822 }
823
824 if (media_action == "deny")
825 {
826 LLNotifications::instance().add("MediaBlocked", args);
827 if (type == 0)
775 { 828 {
776 args["WARNING"] = " (WARNING: this URL also contains parameter(s) that could potentially be used to correlate your avatar name with your IP)"; 829 undoParcelMediaUpdate();
777 } 830 }
778 else 831 if (type == 1)
779 { 832 {
780 args["WARNING"] = ""; 833 LLViewerParcelMedia::stopStreamingMusic();
781 } 834 }
835 // So to avoid other "blocked" messages later in the session
836 // for this url should it be requested again by a script.
837 // We don't add the IP, on purpose (want to show different
838 // blocks for different domains pointing to the same IP).
839 sDeniedMedia.insert(domain);
840 }
841 else
842 {
843 sMediaQueries.insert(domain);
844 args["URL"] = media_url;
782 if (type == 0) 845 if (type == 0)
783 { 846 {
784 args["TYPE"] = "a media"; 847 args["TYPE"] = "media";
785 } 848 }
786 else 849 else
787 { 850 {
788 args["TYPE"] = "an audio"; 851 args["TYPE"] = "audio";
789 } 852 }
790 LLNotifications::instance().add("MediaAlert", args, LLSD(), boost::bind(callback_media_alert, _1, _2, parcel, type, domain)); 853 LLNotifications::instance().add("MediaAlert", args, LLSD(), boost::bind(callback_media_alert, _1, _2, parcel, type, domain));
791 } 854 }
@@ -795,8 +858,19 @@ void callback_media_alert(const LLSD &notification, const LLSD &response, LLParc
795{ 858{
796 S32 option = LLNotification::getSelectedOption(notification, response); 859 S32 option = LLNotification::getSelectedOption(notification, response);
797 860
861 LLHost host;
862 host.setHostByName(domain);
863 std::string ip = host.getIPString();
864
798 LLSD args; 865 LLSD args;
799 args["DOMAIN"] = domain; 866 if (ip != domain && domain.find('/') == std::string::npos)
867 {
868 args["DOMAIN"] = domain + " (" + ip + ")";
869 }
870 else
871 {
872 args["DOMAIN"] = domain;
873 }
800 874
801 if (option == 0 || option == 3) // Allow or Whitelist 875 if (option == 0 || option == 3) // Allow or Whitelist
802 { 876 {
@@ -807,6 +881,11 @@ void callback_media_alert(const LLSD &notification, const LLSD &response, LLParc
807 newmedia["domain"] = domain; 881 newmedia["domain"] = domain;
808 newmedia["action"] = "allow"; 882 newmedia["action"] = "allow";
809 LLViewerParcelMedia::sMediaFilterList.append(newmedia); 883 LLViewerParcelMedia::sMediaFilterList.append(newmedia);
884 if (ip != domain && domain.find('/') == std::string::npos)
885 {
886 newmedia["domain"] = ip;
887 LLViewerParcelMedia::sMediaFilterList.append(newmedia);
888 }
810 LLViewerParcelMedia::saveDomainFilterList(); 889 LLViewerParcelMedia::saveDomainFilterList();
811 args["LISTED"] = "whitelisted"; 890 args["LISTED"] = "whitelisted";
812 LLNotifications::instance().add("MediaListed", args); 891 LLNotifications::instance().add("MediaListed", args);
@@ -823,10 +902,19 @@ void callback_media_alert(const LLSD &notification, const LLSD &response, LLParc
823 else if (option == 1 || option == 2) // Deny or Blacklist 902 else if (option == 1 || option == 2) // Deny or Blacklist
824 { 903 {
825 LLViewerParcelMedia::sDeniedMedia.insert(domain); 904 LLViewerParcelMedia::sDeniedMedia.insert(domain);
826 if (type == 1) 905 if (ip != domain && domain.find('/') == std::string::npos)
906 {
907 LLViewerParcelMedia::sDeniedMedia.insert(ip);
908 }
909 if (type == 0)
910 {
911 LLViewerParcelMedia::undoParcelMediaUpdate();
912 }
913 else if (type == 1)
827 { 914 {
828 LLViewerParcelMedia::stopStreamingMusic(); 915 LLViewerParcelMedia::stopStreamingMusic();
829 } 916 }
917
830 if (option == 1) // Deny 918 if (option == 1) // Deny
831 { 919 {
832 LLNotifications::instance().add("MediaBlocked", args); 920 LLNotifications::instance().add("MediaBlocked", args);
@@ -837,6 +925,11 @@ void callback_media_alert(const LLSD &notification, const LLSD &response, LLParc
837 newmedia["domain"] = domain; 925 newmedia["domain"] = domain;
838 newmedia["action"] = "deny"; 926 newmedia["action"] = "deny";
839 LLViewerParcelMedia::sMediaFilterList.append(newmedia); 927 LLViewerParcelMedia::sMediaFilterList.append(newmedia);
928 if (ip != domain && domain.find('/') == std::string::npos)
929 {
930 newmedia["domain"] = ip;
931 LLViewerParcelMedia::sMediaFilterList.append(newmedia);
932 }
840 LLViewerParcelMedia::saveDomainFilterList(); 933 LLViewerParcelMedia::saveDomainFilterList();
841 args["LISTED"] = "blacklisted"; 934 args["LISTED"] = "blacklisted";
842 LLNotifications::instance().add("MediaListed", args); 935 LLNotifications::instance().add("MediaListed", args);
@@ -928,7 +1021,12 @@ std::string LLViewerParcelMedia::extractDomain(std::string url)
928 url = url.substr(pos + 1, count); 1021 url = url.substr(pos + 1, count);
929 } 1022 }
930 1023
931 if (url.find(gAgent.getRegion()->getHost().getHostName()) == 0 || url.find(last_region) == 0) 1024 std::string current_region = gAgent.getRegion()->getHost().getHostName();
1025 if (!current_region.size())
1026 {
1027 current_region = gAgent.getRegion()->getHost().getIPString();
1028 }
1029 if (url.find(current_region) == 0 || url.find(last_region) == 0)
932 { 1030 {
933 // This must be a scripted object rezzed in the region: 1031 // This must be a scripted object rezzed in the region:
934 // extend the concept of "domain" to encompass the 1032 // extend the concept of "domain" to encompass the
@@ -937,7 +1035,7 @@ std::string LLViewerParcelMedia::extractDomain(std::string url)
937 1035
938 // Get rid of any port number 1036 // Get rid of any port number
939 pos = url.find('/'); // We earlier made sure that there's one 1037 pos = url.find('/'); // We earlier made sure that there's one
940 url = gAgent.getRegion()->getHost().getHostName() + url.substr(pos); 1038 url = current_region + url.substr(pos);
941 1039
942 pos = url.find('?'); 1040 pos = url.find('?');
943 if (pos != std::string::npos) 1041 if (pos != std::string::npos)
@@ -972,6 +1070,73 @@ std::string LLViewerParcelMedia::extractDomain(std::string url)
972 // Remember this region, so to cope with requests occuring just after a 1070 // Remember this region, so to cope with requests occuring just after a
973 // TP out of it. 1071 // TP out of it.
974 last_region = gAgent.getRegion()->getHost().getHostName(); 1072 last_region = gAgent.getRegion()->getHost().getHostName();
1073 if (!last_region.size())
1074 {
1075 last_region = gAgent.getRegion()->getHost().getIPString();
1076 }
975 1077
976 return url; 1078 return url;
977} 1079}
1080
1081LLViewerParcelMediaInfo::LLViewerParcelMediaInfo(const std::string url,
1082 const std::string type,
1083 const LLUUID media_id,
1084 const S32 width,
1085 const S32 height,
1086 const U8 scale,
1087 const U8 loop)
1088 :
1089 mMediaURL(url),
1090 mMediaType(type),
1091 mMediaID(media_id),
1092 mMediaWidth(width),
1093 mMediaHeight(height),
1094 mMediaAutoScale(scale),
1095 mMediaLoop(loop)
1096{
1097 LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
1098 mParcelLocalID = parcel ? parcel->getLocalID() : 0;
1099}
1100
1101LLViewerParcelMediaInfo::LLViewerParcelMediaInfo(const LLParcel* parcel)
1102{
1103 mMediaURL = parcel->getMediaURL();
1104 mMediaType = parcel->getMediaType();
1105 mMediaID = parcel->getMediaID();
1106 mMediaWidth = parcel->getMediaWidth();
1107 mMediaHeight = parcel->getMediaHeight();
1108 mMediaAutoScale = parcel->getMediaAutoScale();
1109 mMediaLoop = parcel->getMediaLoop();
1110 mParcelLocalID = parcel->getLocalID();
1111}
1112
1113void LLViewerParcelMediaInfo::applyToParcel(LLParcel* parcel)
1114{
1115 if (parcel && sameParcel(parcel))
1116 {
1117 parcel->setMediaURL(mMediaURL);
1118 parcel->setMediaType(mMediaType);
1119 parcel->setMediaID(mMediaID);
1120 parcel->setMediaWidth(mMediaWidth);
1121 parcel->setMediaHeight(mMediaHeight);
1122 parcel->setMediaAutoScale(mMediaAutoScale);
1123 parcel->setMediaLoop(mMediaLoop);
1124 }
1125}
1126
1127bool LLViewerParcelMediaInfo::sameParcel(const LLParcel* parcel) const
1128{
1129 return parcel && (parcel->getLocalID() == mParcelLocalID);
1130}
1131
1132bool LLViewerParcelMediaInfo::operator==(const LLViewerParcelMediaInfo &rhs) const
1133{
1134 return (mMediaURL == rhs.mMediaURL) &&
1135 (mMediaType == rhs.mMediaType) &&
1136 (mMediaID == rhs.mMediaID) &&
1137 (mMediaWidth == rhs.mMediaWidth) &&
1138 (mMediaHeight == rhs.mMediaHeight) &&
1139 (mMediaAutoScale == rhs.mMediaAutoScale) &&
1140 (mMediaLoop == rhs.mMediaLoop) &&
1141 (mParcelLocalID == rhs.mParcelLocalID);
1142} \ No newline at end of file
diff --git a/linden/indra/newview/llviewerparcelmedia.h b/linden/indra/newview/llviewerparcelmedia.h
index 7531a0f..f4c4312 100644
--- a/linden/indra/newview/llviewerparcelmedia.h
+++ b/linden/indra/newview/llviewerparcelmedia.h
@@ -34,6 +34,7 @@
34#define LLVIEWERPARCELMEDIA_H 34#define LLVIEWERPARCELMEDIA_H
35 35
36#include "llviewermedia.h" 36#include "llviewermedia.h"
37#include "llmemory.h"
37 38
38// For use by other patches so they know that media filtering is implemented. 39// For use by other patches so they know that media filtering is implemented.
39#define MEDIA_FILTERING 1 40#define MEDIA_FILTERING 1
@@ -41,6 +42,7 @@
41class LLMessageSystem; 42class LLMessageSystem;
42class LLParcel; 43class LLParcel;
43class LLViewerParcelMediaNavigationObserver; 44class LLViewerParcelMediaNavigationObserver;
45class LLViewerParcelMediaInfo;
44 46
45 47
46// This class understands land parcels, network traffic, LSL media 48// This class understands land parcels, network traffic, LSL media
@@ -49,6 +51,13 @@ class LLViewerParcelMediaNavigationObserver;
49class LLViewerParcelMedia : public LLViewerMediaObserver 51class LLViewerParcelMedia : public LLViewerMediaObserver
50{ 52{
51 LOG_CLASS(LLViewerParcelMedia); 53 LOG_CLASS(LLViewerParcelMedia);
54 private:
55 typedef enum e_command_origin
56 {
57 COMMAND_ORIGIN_LOCAL,
58 COMMAND_ORIGIN_REMOTE
59 } ECommandOrigin;
60
52 public: 61 public:
53 static void initClass(); 62 static void initClass();
54 static void cleanupClass(); 63 static void cleanupClass();
@@ -57,14 +66,14 @@ class LLViewerParcelMedia : public LLViewerMediaObserver
57 // called when the agent's parcel has a new URL, or the agent has 66 // called when the agent's parcel has a new URL, or the agent has
58 // walked on to a new parcel with media 67 // walked on to a new parcel with media
59 68
60 static void play(LLParcel* parcel, bool filter = true); 69 static void play(LLParcel* parcel, bool filter = true, const ECommandOrigin origin = COMMAND_ORIGIN_LOCAL);
61 // user clicked play button in media transport controls 70 // user clicked play button in media transport controls
62 static void playStreamingMusic(LLParcel* parcel, bool filter = true); 71 static void playStreamingMusic(LLParcel* parcel, bool filter = true);
63 // play the parcel music stream 72 // play the parcel music stream
64 static void stopStreamingMusic(); 73 static void stopStreamingMusic();
65 // stop the parcel music stream 74 // stop the parcel music stream
66 75
67 static void filterMedia(LLParcel* parcel, U32 type); // type: 0 = media, 1 = streaming music 76 static void filterMedia(LLParcel* parcel, U32 type, const ECommandOrigin origin); // type: 0 = media, 1 = streaming music
68 static bool allowedMedia(std::string media_url); 77 static bool allowedMedia(std::string media_url);
69 78
70 static bool loadDomainFilterList(); 79 static bool loadDomainFilterList();
@@ -90,6 +99,7 @@ class LLViewerParcelMedia : public LLViewerMediaObserver
90 99
91 static void processParcelMediaCommandMessage( LLMessageSystem *msg, void ** ); 100 static void processParcelMediaCommandMessage( LLMessageSystem *msg, void ** );
92 static void processParcelMediaUpdate( LLMessageSystem *msg, void ** ); 101 static void processParcelMediaUpdate( LLMessageSystem *msg, void ** );
102 static void undoParcelMediaUpdate(); // reset the parcel's media to what it was before ParcelMediaUpdate
93 static void sendMediaNavigateMessage(const std::string& url); 103 static void sendMediaNavigateMessage(const std::string& url);
94 104
95 // inherited from LLViewerMediaObserver 105 // inherited from LLViewerMediaObserver
@@ -107,6 +117,7 @@ class LLViewerParcelMedia : public LLViewerMediaObserver
107 static std::set<std::string> sMediaQueries; 117 static std::set<std::string> sMediaQueries;
108 static std::set<std::string> sAllowedMedia; 118 static std::set<std::string> sAllowedMedia;
109 static std::set<std::string> sDeniedMedia; 119 static std::set<std::string> sDeniedMedia;
120 static LLPointer<LLViewerParcelMediaInfo> sSavedMediaInfo; // The parcel original media (before a remote command is applied)
110}; 121};
111 122
112 123
@@ -120,4 +131,29 @@ public:
120 131
121}; 132};
122 133
134class LLViewerParcelMediaInfo : public LLRefCount
135{
136public:
137 LLViewerParcelMediaInfo(const std::string url,
138 const std::string type,
139 const LLUUID media_id,
140 const S32 width,
141 const S32 height,
142 const U8 scale,
143 const U8 loop);
144 LLViewerParcelMediaInfo(const LLParcel* parcel);
145 ~LLViewerParcelMediaInfo() {}
146 void applyToParcel(LLParcel* parcel);
147 bool sameParcel(const LLParcel* parcel) const;
148 bool operator==(const LLViewerParcelMediaInfo &rhs) const;
149private:
150 std::string mMediaURL;
151 std::string mMediaType;
152 LLUUID mMediaID;
153 S32 mMediaWidth;
154 S32 mMediaHeight;
155 U8 mMediaAutoScale;
156 U8 mMediaLoop;
157 S32 mParcelLocalID;
158};
123#endif 159#endif
diff --git a/linden/indra/newview/llworldmap.cpp b/linden/indra/newview/llworldmap.cpp
index bd3996d..608d720 100644
--- a/linden/indra/newview/llworldmap.cpp
+++ b/linden/indra/newview/llworldmap.cpp
@@ -81,7 +81,9 @@ LLSimInfo::LLSimInfo()
81 mAccess(0x0), 81 mAccess(0x0),
82 mRegionFlags(0x0), 82 mRegionFlags(0x0),
83 mWaterHeight(0.f), 83 mWaterHeight(0.f),
84 mAlpha(-1.f) 84 mAlpha(-1.f),
85 msizeX(REGION_WIDTH_UNITS),
86 msizeY(REGION_WIDTH_UNITS)
85{ 87{
86} 88}
87 89
diff --git a/linden/indra/newview/llworldmapview.cpp b/linden/indra/newview/llworldmapview.cpp
index 8d9ed1b..d7a6838 100644
--- a/linden/indra/newview/llworldmapview.cpp
+++ b/linden/indra/newview/llworldmapview.cpp
@@ -472,7 +472,7 @@ void LLWorldMapView::draw()
472 F32 bottom = sPanY + half_height + relative_y; 472 F32 bottom = sPanY + half_height + relative_y;
473 F32 left = sPanX + half_width + relative_x; 473 F32 left = sPanX + half_width + relative_x;
474 F32 top = bottom+ (sMapScale * info->msizeY / REGION_WIDTH_METERS); 474 F32 top = bottom+ (sMapScale * info->msizeY / REGION_WIDTH_METERS);
475 F32 right = left + (sMapScale * info->msizeY / REGION_WIDTH_METERS); 475 F32 right = left + (sMapScale * info->msizeX / REGION_WIDTH_METERS);
476 476
477 // Switch to world map texture (if available for this region) if either: 477 // Switch to world map texture (if available for this region) if either:
478 // 1. Tiles are zoomed out small enough, or 478 // 1. Tiles are zoomed out small enough, or
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_about_land.xml b/linden/indra/newview/skins/default/xui/en-us/floater_about_land.xml
index c8aacba..453bf46 100644
--- a/linden/indra/newview/skins/default/xui/en-us/floater_about_land.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_about_land.xml
@@ -915,32 +915,18 @@ Only large parcels can be listed in search.
915 right="-12" 915 right="-12"
916 scale_image="true" 916 scale_image="true"
917 width="70" /> 917 width="70" />
918 <check_box
919 bottom_delta="-22"
920 enabled="true"
921 follows="left|top"
922 font="SansSerifSmall"
923 height="16"
924 initial_value="false"
925 label="Hide URL"
926 left="80"
927 mouse_opaque="true"
928 name="hide_media_url"
929 radio_style="false"
930 tool_tip="Checking this option will hide the media URL from any non-authorized viewers of this parcel information. Note this is not available for HTML types."
931 width="150" />
932 <text 918 <text
933 bottom_delta="0" 919 bottom_delta="-22"
934 follows="right|top" 920 follows="right|top"
935 font="SansSerifSmall" 921 font="SansSerifSmall"
936 halign="right" 922 halign="left"
937 height="16" 923 height="16"
938 length="1" 924 length="1"
939 name="media_reset" 925 name="media_reset"
940 right="-164" 926 left="80"
941 tool_tip="Amount of time until parcel automatically reverts to default URL (0 for never return)" 927 tool_tip="Amount of time until parcel automatically reverts to default URL (0 for never return)"
942 type="string" 928 type="string"
943 width="185"> 929 width="120">
944 Return to Home URL in: 930 Return to Home URL in:
945 </text> 931 </text>
946 <spinner 932 <spinner
@@ -948,14 +934,13 @@ Only large parcels can be listed in search.
948 decimal_digits="0" 934 decimal_digits="0"
949 enabled="false" 935 enabled="false"
950 follows="right|top" 936 follows="right|top"
951 halign="right"
952 height="16" 937 height="16"
953 increment="1" 938 increment="1"
954 initial_val="0" 939 initial_val="0"
955 max_val="1024" 940 max_val="1024"
956 min_val="0" 941 min_val="0"
957 name="media_reset_time" 942 name="media_reset_time"
958 right="-90" 943 left_delta="126"
959 tool_tip="Amount of time until parcel reverts to default URL (0 for never return)" 944 tool_tip="Amount of time until parcel reverts to default URL (0 for never return)"
960 width="64" /> 945 width="64" />
961 <text 946 <text
@@ -964,12 +949,11 @@ Only large parcels can be listed in search.
964 font="SansSerifSmall" 949 font="SansSerifSmall"
965 halign="left" 950 halign="left"
966 height="16" 951 height="16"
967 left_delta="70" 952 left_delta="72"
968 length="1" 953 length="1"
969 name="minutes" 954 name="minutes"
970 right="-10"
971 type="string"> 955 type="string">
972 Minutes 956 minutes
973 </text> 957 </text>
974 <text 958 <text
975 bottom_delta="-22" 959 bottom_delta="-22"
@@ -1315,20 +1299,6 @@ Select the thumbnail to choose a different texture.
1315 name="music_url" 1299 name="music_url"
1316 right="-15" 1300 right="-15"
1317 select_on_focus="true" /> 1301 select_on_focus="true" />
1318 <check_box
1319 bottom_delta="-25"
1320 enabled="true"
1321 follows="left|top"
1322 font="SansSerifSmall"
1323 height="16"
1324 initial_value="false"
1325 label="Hide URL"
1326 left="80"
1327 mouse_opaque="true"
1328 name="hide_music_url"
1329 radio_style="false"
1330 tool_tip="Checking this option will hide the music URL from any non-authorized viewers of this parcel information."
1331 width="150" />
1332 <text 1302 <text
1333 bottom_delta="-65" 1303 bottom_delta="-65"
1334 follows="left|top" 1304 follows="left|top"
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_media_filter.xml b/linden/indra/newview/skins/default/xui/en-us/floater_media_filter.xml
index 9b7355c..f0fb3a3 100644
--- a/linden/indra/newview/skins/default/xui/en-us/floater_media_filter.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_media_filter.xml
@@ -1,9 +1,22 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?> 1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<floater name="floatermediafilter" title="Media Filter" rect_control="MediaFilterRect" 2<floater name="floatermediafilter" title="Media Filter" rect_control="MediaFilterRect"
3 can_close="true" can_drag_on_left="false" can_minimize="true" can_resize="true" 3 can_close="true" can_drag_on_left="false" can_minimize="true" can_resize="true"
4 height="350" width="600" min_height="350" min_width="600"> 4 height="410" width="600" min_height="350" min_width="600">
5
6 <check_box control_name="MediaEnableFilter" name="enable_mediafilter" label="Enable Media Filter"
7 initial_value="true" tool_tip="Enables filtering media URLs by domain names."
8 font="SansSerifSmall" mouse_opaque="true"
9 left="14" height="16" bottom_delta="-45" width="4500" follows="left|top" />
10
11 <check_box control_name="MediaFilterOnlyRemoteCommands" name="filter_only_remote"
12 label="Filter only when a script initiates the stream (less secure)" initial_value="false"
13 tool_tip="This will prevent popups asking about URLs that are permanently set on a parcel.
14Only scripted changes to the media URL and scripted requests to start playing a stream will be filtered."
15 font="SansSerifSmall" mouse_opaque="true"
16 left_delta="14" height="16" width="450" follows="left|top" />
17
5 <text name="info1" font="SansSerif" mouse_opaque="true" halign="center" 18 <text name="info1" font="SansSerif" mouse_opaque="true" halign="center"
6 bottom_delta="-45" left="20" height="20" width="560" follows="left|right|top"> 19 bottom_delta="-40" left="20" height="20" width="560" follows="left|right|top">
7 Domains in bold are in the persistent list (i.e. they are whitelisted or blacklisted). 20 Domains in bold are in the persistent list (i.e. they are whitelisted or blacklisted).
8 </text> 21 </text>
9 <text name="info2" font="SansSerif" mouse_opaque="true" halign="center" 22 <text name="info2" font="SansSerif" mouse_opaque="true" halign="center"
@@ -14,48 +27,68 @@
14 <scroll_list name="whitelist_list" follows="top|bottom|left" 27 <scroll_list name="whitelist_list" follows="top|bottom|left"
15 background_visible="true" mouse_opaque="true" 28 background_visible="true" mouse_opaque="true"
16 multi_select="false" column_padding="5" draw_border="true" draw_heading="true" 29 multi_select="false" column_padding="5" draw_border="true" draw_heading="true"
17 bottom_delta="-205" left="15" height="200" width="280"> 30 bottom_delta="-200" left="15" height="200" width="280">
18 <column name="whitelist_col" label="Allowed domains/objects" dynamicwidth="true" /> 31 <column name="whitelist_col" label="Allowed domains or server objects" dynamicwidth="true" />
19 </scroll_list> 32 </scroll_list>
20 33
21 <scroll_list name="blacklist_list" follows="top|bottom|right" 34 <scroll_list name="blacklist_list" follows="top|bottom|right"
22 background_visible="true" mouse_opaque="true" 35 background_visible="true" mouse_opaque="true"
23 multi_select="false" column_padding="5" draw_border="true" draw_heading="true" 36 multi_select="false" column_padding="5" draw_border="true" draw_heading="true"
24 bottom_delta="0" right="-15" height="200" width="280"> 37 bottom_delta="0" right="-15" height="200" width="280">
25 <column name="blacklist_col" label="Blocked domains/objects" dynamicwidth="true" /> 38 <column name="blacklist_col" label="Blocked domains or server objects" dynamicwidth="true" />
26 </scroll_list> 39 </scroll_list>
27 40
28 <button name="add_whitelist" font="SansSerif" label="Add..." halign="center" 41 <button name="add_whitelist" font="SansSerif" label="Add..." halign="center"
42 tool_tip="Add a server to the whitelist"
29 enabled="true" mouse_opaque="true" follows="bottom|left" 43 enabled="true" mouse_opaque="true" follows="bottom|left"
30 bottom_delta="-25" left="30" height="20" width="80" /> 44 bottom_delta="-25" left="15" height="20" width="80" />
31 45
32 <button name="remove_whitelist" font="SansSerif" label="Remove" halign="center" 46 <button name="remove_whitelist" font="SansSerif" label="Remove" halign="center"
47 tool_tip="Remove the selected server from the whitelist"
33 enabled="true" mouse_opaque="true" follows="bottom|left" 48 enabled="true" mouse_opaque="true" follows="bottom|left"
34 bottom_delta="0" left_delta="100" height="20" width="80" /> 49 bottom_delta="0" left="100" height="20" width="80" />
35 50
36 <button name="clear_lists" font="SansSerif" label="Clear lists" halign="center" 51 <button name="clear_lists" font="SansSerif" label="Clear lists" halign="center"
37 enabled="true" mouse_opaque="true" follows="bottom|left|right" 52 tool_tip="Clear all lists"
38 bottom_delta="0" left_delta="110" height="20" width="120" /> 53 enabled="true" mouse_opaque="true" follows="bottom|left"
54 bottom_delta="0" left="205" height="20" width="90" />
55
56 <button name="show_ips" font="SansSerif" label="Show IPs" halign="center"
57 tool_tip="Show the IP associated with each domain name (makes the viewer pause while the list is refreshed, because of DNS lookups)"
58 enabled="true" mouse_opaque="true" follows="bottom|right"
59 bottom_delta="0" right="-205" height="20" width="90" />
39 60
40 <button name="add_blacklist" font="SansSerif" label="Add..." halign="center" 61 <button name="add_blacklist" font="SansSerif" label="Add..." halign="center"
62 tool_tip="Add a server to the blacklist"
41 enabled="true" mouse_opaque="true" follows="bottom|right" 63 enabled="true" mouse_opaque="true" follows="bottom|right"
42 bottom_delta="0" right="-130" height="20" width="80" /> 64 bottom_delta="0" right="-100" height="20" width="80" />
43 65
44 <button name="remove_blacklist" font="SansSerif" label="Remove" halign="center" 66 <button name="remove_blacklist" font="SansSerif" label="Remove" halign="center"
67 tool_tip="Remove the selected server from the blacklist"
45 enabled="true" mouse_opaque="true" follows="bottom|right" 68 enabled="true" mouse_opaque="true" follows="bottom|right"
46 bottom_delta="0" right="-30" height="20" width="80" /> 69 bottom_delta="0" right="-15" height="20" width="80" />
47 70
48 <text name="add_text" font="SansSerif" mouse_opaque="true" enabled="true" 71 <text name="add_text" font="SansSerif" mouse_opaque="true"
49 bottom_delta="-25" left="20" height="20" width="500" follows="left|right|bottom"> 72 bottom_delta="-25" left="20" height="20" width="450" follows="left|right|bottom">
50 New domain: 73 New domain:
51 </text> 74 </text>
52 75
76 <check_box name="match_ip" label="Add/remove matching IP" initial_value="true"
77 tool_tip="Add or remove any IP associated with the added or removed domain name"
78 font="SansSerifSmall" mouse_opaque="true" radio_style="false"
79 bottom_delta="2" right="-95" height="16" width="70" follows="right|bottom" />
80
53 <line_editor name="input_domain" max_length="255" font="SansSerif" enabled="false" 81 <line_editor name="input_domain" max_length="255" font="SansSerif" enabled="false"
82 tool_tip="Enter the new URL, domain name, IP or scripted object HTTP server path here"
54 select_all_on_focus_received="true" select_on_focus="true" 83 select_all_on_focus_received="true" select_on_focus="true"
55 bevel_style="in" border_style="line" border_thickness="1" 84 bevel_style="in" border_style="line" border_thickness="1"
56 bottom_delta="-20" right="-100" height="20" left="15" follows="left|bottom|right"/> 85 bottom_delta="-22" right="-180" height="20" left="15" follows="left|bottom|right"/>
57 86
58 <button name="commit_domain" font="SansSerif" label="Add" halign="center" enabled="false" 87 <button name="cancel_domain" font="SansSerif" label="Cancel" halign="center" enabled="false"
59 mouse_opaque="true" follows="bottom|right" 88 mouse_opaque="true" follows="bottom|right"
60 bottom_delta="0" right="-15" height="20" width="80"/> 89 bottom_delta="0" right="-15" height="20" width="80"/>
90 <button name="commit_domain" font="SansSerif" label="Add" halign="center" enabled="false"
91 tool_tip="Add to the list"
92 mouse_opaque="true" follows="bottom|right"
93 bottom_delta="0" right="-95" height="20" width="80"/>
61</floater> 94</floater>
diff --git a/linden/indra/newview/skins/default/xui/en-us/mime_types_linux.xml b/linden/indra/newview/skins/default/xui/en-us/mime_types_linux.xml
index e95b371..f0ba830 100755
--- a/linden/indra/newview/skins/default/xui/en-us/mime_types_linux.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/mime_types_linux.xml
@@ -431,6 +431,17 @@
431 media_plugin_gstreamer 431 media_plugin_gstreamer
432 </impl> 432 </impl>
433 </mimetype> 433 </mimetype>
434 <mimetype name="video/x-m4v">
435 <label name="video/m4v_label">
436 Movie (M4V)
437 </label>
438 <widgettype>
439 movie
440 </widgettype>
441 <impl>
442 media_plugin_gstreamer
443 </impl>
444 </mimetype>
434 <mimetype menu="1" name="video/quicktime"> 445 <mimetype menu="1" name="video/quicktime">
435 <label name="video/quicktime_label"> 446 <label name="video/quicktime_label">
436 Movie (QuickTime) 447 Movie (QuickTime)
diff --git a/linden/indra/newview/skins/default/xui/en-us/mime_types_mac.xml b/linden/indra/newview/skins/default/xui/en-us/mime_types_mac.xml
index 7931e55..e1751eb 100755
--- a/linden/indra/newview/skins/default/xui/en-us/mime_types_mac.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/mime_types_mac.xml
@@ -431,6 +431,17 @@
431 media_plugin_quicktime 431 media_plugin_quicktime
432 </impl> 432 </impl>
433 </mimetype> 433 </mimetype>
434 <mimetype name="video/x-m4v">
435 <label name="video/m4v_label">
436 Movie (M4V)
437 </label>
438 <widgettype>
439 movie
440 </widgettype>
441 <impl>
442 media_plugin_gstreamer
443 </impl>
444 </mimetype>
434 <mimetype menu="1" name="video/quicktime"> 445 <mimetype menu="1" name="video/quicktime">
435 <label name="video/quicktime_label"> 446 <label name="video/quicktime_label">
436 Movie (QuickTime) 447 Movie (QuickTime)
diff --git a/linden/indra/newview/skins/default/xui/en-us/mime_types_windows.xml b/linden/indra/newview/skins/default/xui/en-us/mime_types_windows.xml
index 5ee4ed0..26491e0 100644
--- a/linden/indra/newview/skins/default/xui/en-us/mime_types_windows.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/mime_types_windows.xml
@@ -428,8 +428,19 @@
428 movie 428 movie
429 </widgettype> 429 </widgettype>
430 <impl> 430 <impl>
431 media_plugin_quicktime 431 media_plugin_quicktime
432 </impl> 432 </impl>
433 </mimetype>
434 <mimetype name="video/x-m4v">
435 <label name="video/m4v_label">
436 Movie (M4V)
437 </label>
438 <widgettype>
439 movie
440 </widgettype>
441 <impl>
442 media_plugin_gstreamer
443 </impl>
433 </mimetype> 444 </mimetype>
434 <mimetype menu="1" name="video/quicktime"> 445 <mimetype menu="1" name="video/quicktime">
435 <label name="video/quicktime_label"> 446 <label name="video/quicktime_label">
diff --git a/linden/indra/newview/skins/default/xui/en-us/notifications.xml b/linden/indra/newview/skins/default/xui/en-us/notifications.xml
index eb8860d..306e3b8 100644
--- a/linden/indra/newview/skins/default/xui/en-us/notifications.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/notifications.xml
@@ -7343,11 +7343,15 @@ The Second Life Terms of Service do not allow you to opt out. By logging in to S
7343 icon="alert.tga" 7343 icon="alert.tga"
7344 name="MediaAlert" 7344 name="MediaAlert"
7345 type="alert"> 7345 type="alert">
7346The owner of this parcel has requested [TYPE] URL pertaining to the following domain or scripted object to be loaded by your viewer[WARNING]: 7346The owner of this parcel has requested the following [TYPE] URL to be loaded by your viewer:
7347
7348[URL]
7349
7350You may choose to allow or deny the corresponding domain or in-world scripted object server:
7347 7351
7348[DOMAIN] 7352[DOMAIN]
7349 7353
7350"Allow" and "Deny" apply only for this session, while "Blacklist" and "Whitelist" apply forever to the above domain or scripted object. 7354"Allow" and "Deny" apply only for this session, while "Blacklist" and "Whitelist" apply forever.
7351 <form name="form"> 7355 <form name="form">
7352 <button 7356 <button
7353 index="0" 7357 index="0"
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_audio.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_audio.xml
index 1f208e8..355d7e8 100644
--- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_audio.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_audio.xml
@@ -9,13 +9,13 @@
9 Volume: 9 Volume:
10 </text> 10 </text>
11 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 11 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
12 bottom="-190" drop_shadow_visible="true" enabled="true" follows="left|top" 12 bottom="-202" drop_shadow_visible="true" enabled="true" follows="left|top"
13 font="SansSerifSmall" h_pad="0" halign="left" height="12" left="10" 13 font="SansSerifSmall" h_pad="0" halign="left" height="12" left="10"
14 mouse_opaque="true" name="streaming_prefs_text" v_pad="0" width="128"> 14 mouse_opaque="true" name="streaming_prefs_text" v_pad="0" width="128">
15 Streaming: 15 Streaming:
16 </text> 16 </text>
17 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 17 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
18 bottom="-285" drop_shadow_visible="true" enabled="true" follows="left|top" 18 bottom="-315" drop_shadow_visible="true" enabled="true" follows="left|top"
19 font="SansSerifSmall" h_pad="0" halign="left" height="12" left="10" 19 font="SansSerifSmall" h_pad="0" halign="left" height="12" left="10"
20 mouse_opaque="true" name="audio_prefs_text" v_pad="0" width="128"> 20 mouse_opaque="true" name="audio_prefs_text" v_pad="0" width="128">
21 Audio: 21 Audio:
@@ -47,7 +47,16 @@
47 initial_value="true" label="Media helper widget" left="162" 47 initial_value="true" label="Media helper widget" left="162"
48 mouse_opaque="true" name="media_helper_widget" radio_style="false" 48 mouse_opaque="true" name="media_helper_widget" radio_style="false"
49 width="338" /> 49 width="338" />
50 <check_box bottom_delta="-27" control_name="MuteWhenMinimized" enabled="true" 50 <check_box bottom_delta="-20" control_name="MediaEnableFilter" enabled="true"
51 follows="left|top" font="SansSerifSmall" height="16"
52 initial_value="true" label="Filter media URLs" left="142"
53 mouse_opaque="true" name="enable_media_filter" radio_style="false"
54 width="200" />
55 <button name="show_media_filter" font="SansSerif" label="Media Filter Settings" halign="center"
56 tool_tip="Edit settings and the blocked and allowed lists for the Media Filter."
57 enabled="false" mouse_opaque="true" follows="top|right"
58 bottom_delta="-2" right="-15" height="20" width="180" />
59 <check_box bottom_delta="-33" control_name="MuteWhenMinimized" enabled="true"
51 follows="left|top" font="SansSerifSmall" height="16" initial_value="true" 60 follows="left|top" font="SansSerifSmall" height="16" initial_value="true"
52 label="Mute audio when window minimized" left="142" mouse_opaque="true" 61 label="Mute audio when window minimized" left="142" mouse_opaque="true"
53 name="mute_when_minimized" radio_style="false" width="215" /> 62 name="mute_when_minimized" radio_style="false" width="215" />
diff --git a/linden/indra/newview/slfloatermediafilter.cpp b/linden/indra/newview/slfloatermediafilter.cpp
index c47ed26..b0d9c26 100644
--- a/linden/indra/newview/slfloatermediafilter.cpp
+++ b/linden/indra/newview/slfloatermediafilter.cpp
@@ -43,6 +43,8 @@
43 43
44SLFloaterMediaFilter* SLFloaterMediaFilter::sInstance = NULL; 44SLFloaterMediaFilter* SLFloaterMediaFilter::sInstance = NULL;
45bool SLFloaterMediaFilter::sIsWhitelist = false; 45bool SLFloaterMediaFilter::sIsWhitelist = false;
46bool SLFloaterMediaFilter::sIsAdding = false;
47bool SLFloaterMediaFilter::sShowIPs = false;
46 48
47SLFloaterMediaFilter::SLFloaterMediaFilter() : LLFloater(std::string("media filter")), mIsDirty(false) 49SLFloaterMediaFilter::SLFloaterMediaFilter() : LLFloater(std::string("media filter")), mIsDirty(false)
48{ 50{
@@ -62,15 +64,18 @@ BOOL SLFloaterMediaFilter::postBuild()
62 if (mWhitelistSLC && mBlacklistSLC) 64 if (mWhitelistSLC && mBlacklistSLC)
63 { 65 {
64 childSetAction("clear_lists", onClearLists, this); 66 childSetAction("clear_lists", onClearLists, this);
67 childSetAction("show_ips", onShowIPs, this);
65 childSetAction("add_whitelist", onWhitelistAdd, this); 68 childSetAction("add_whitelist", onWhitelistAdd, this);
66 childSetAction("remove_whitelist", onWhitelistRemove, this); 69 childSetAction("remove_whitelist", onWhitelistRemove, this);
67 childSetAction("add_blacklist", onBlacklistAdd, this); 70 childSetAction("add_blacklist", onBlacklistAdd, this);
68 childSetAction("remove_blacklist", onBlacklistRemove, this); 71 childSetAction("remove_blacklist", onBlacklistRemove, this);
69 childSetAction("commit_domain", onCommitDomain, this); 72 childSetAction("commit_domain", onCommitDomain, this);
73 childSetAction("cancel_domain", onCancelDomain, this);
70 childSetUserData("whitelist_list", this); 74 childSetUserData("whitelist_list", this);
71 childSetUserData("blacklist_list", this); 75 childSetUserData("blacklist_list", this);
72 mIsDirty = true; 76 mIsDirty = true;
73 } 77 }
78 gSavedSettings.getControl("MediaEnableFilter")->getSignal()->connect(boost::bind(&onMediaEnableFilterChanged, _1));
74 79
75 return TRUE; 80 return TRUE;
76} 81}
@@ -84,6 +89,8 @@ void SLFloaterMediaFilter::draw()
84 mWhitelistSLC->deleteAllItems(); 89 mWhitelistSLC->deleteAllItems();
85 mBlacklistSLC->deleteAllItems(); 90 mBlacklistSLC->deleteAllItems();
86 std::set<std::string> listed; 91 std::set<std::string> listed;
92 LLHost host;
93 std::string ip;
87 std::string domain; 94 std::string domain;
88 std::string action; 95 std::string action;
89 LLSD element; 96 LLSD element;
@@ -92,6 +99,16 @@ void SLFloaterMediaFilter::draw()
92 for (S32 i = 0; i < (S32)LLViewerParcelMedia::sMediaFilterList.size(); i++) 99 for (S32 i = 0; i < (S32)LLViewerParcelMedia::sMediaFilterList.size(); i++)
93 { 100 {
94 domain = LLViewerParcelMedia::sMediaFilterList[i]["domain"].asString(); 101 domain = LLViewerParcelMedia::sMediaFilterList[i]["domain"].asString();
102 if (sShowIPs)
103 {
104 host.setHostByName(domain);
105 ip = host.getIPString();
106 if (ip != domain && domain.find('/') == std::string::npos)
107 {
108 domain += " (" + ip + ")";
109 }
110 }
111
95 action = LLViewerParcelMedia::sMediaFilterList[i]["action"].asString(); 112 action = LLViewerParcelMedia::sMediaFilterList[i]["action"].asString();
96 if (!domain.empty() && action == "allow") 113 if (!domain.empty() && action == "allow")
97 { 114 {
@@ -123,6 +140,15 @@ void SLFloaterMediaFilter::draw()
123 for (it = LLViewerParcelMedia::sAllowedMedia.begin(); it != LLViewerParcelMedia::sAllowedMedia.end(); it++) 140 for (it = LLViewerParcelMedia::sAllowedMedia.begin(); it != LLViewerParcelMedia::sAllowedMedia.end(); it++)
124 { 141 {
125 domain = *it; 142 domain = *it;
143 if (sShowIPs)
144 {
145 host.setHostByName(domain);
146 ip = host.getIPString();
147 if (ip != domain && domain.find('/') == std::string::npos)
148 {
149 domain += " (" + ip + ")";
150 }
151 }
126 if (listed.count(domain) == 0) 152 if (listed.count(domain) == 0)
127 { 153 {
128 element["columns"][0]["value"] = domain; 154 element["columns"][0]["value"] = domain;
@@ -133,6 +159,15 @@ void SLFloaterMediaFilter::draw()
133 for (it = LLViewerParcelMedia::sDeniedMedia.begin(); it != LLViewerParcelMedia::sDeniedMedia.end(); it++) 159 for (it = LLViewerParcelMedia::sDeniedMedia.begin(); it != LLViewerParcelMedia::sDeniedMedia.end(); it++)
134 { 160 {
135 domain = *it; 161 domain = *it;
162 if (sShowIPs)
163 {
164 host.setHostByName(domain);
165 ip = host.getIPString();
166 if (ip != domain && domain.find('/') == std::string::npos)
167 {
168 domain += " (" + ip + ")";
169 }
170 }
136 if (listed.count(domain) == 0) 171 if (listed.count(domain) == 0)
137 { 172 {
138 element["columns"][0]["value"] = domain; 173 element["columns"][0]["value"] = domain;
@@ -142,26 +177,56 @@ void SLFloaterMediaFilter::draw()
142 mWhitelistSLC->setScrollPos(whitescrollpos); 177 mWhitelistSLC->setScrollPos(whitescrollpos);
143 mBlacklistSLC->setScrollPos(blackscrollpos); 178 mBlacklistSLC->setScrollPos(blackscrollpos);
144 179
145 if (!gSavedSettings.getBOOL("MediaEnableFilter")) 180 updateWidgets();
146 {
147 childDisable("clear_lists");
148 childDisable("blacklist_list");
149 childDisable("whitelist_list");
150 childDisable("remove_whitelist");
151 childDisable("add_whitelist");
152 childDisable("remove_blacklist");
153 childDisable("add_blacklist");
154 childDisable("input_domain");
155 childDisable("commit_domain");
156 childSetText("add_text", std::string("****** WARNING: media filtering is currently DISABLED ******"));
157 }
158 181
159 mIsDirty = false; 182 mIsDirty = false;
183 sShowIPs = false;
160 } 184 }
161 185
162 LLFloater::draw(); 186 LLFloater::draw();
163} 187}
164 188
189void SLFloaterMediaFilter::updateWidgets()
190{
191 bool enabled = gSavedSettings.getBOOL("MediaEnableFilter");
192 childSetEnabled("clear_lists", enabled && !sIsAdding);
193 childSetEnabled("show_ips", enabled && !sIsAdding);
194 childSetEnabled("blacklist_list", enabled && !sIsAdding);
195 childSetEnabled("whitelist_list", enabled && !sIsAdding);
196 childSetEnabled("remove_whitelist", enabled && !sIsAdding);
197 childSetEnabled("add_whitelist", enabled && !sIsAdding);
198 childSetEnabled("remove_blacklist", enabled && !sIsAdding);
199 childSetEnabled("add_blacklist", enabled && !sIsAdding);
200 childSetEnabled("match_ip", enabled);
201 childSetEnabled("input_domain", enabled && sIsAdding);
202 childSetEnabled("commit_domain", enabled && sIsAdding);
203 childSetEnabled("cancel_domain", enabled && sIsAdding);
204 childSetEnabled("filter_only_remote", enabled);
205 childSetEnabled("info1", enabled);
206 childSetEnabled("info2", enabled);
207
208 std::string add_text("****** Media filtering is currently DISABLED ******");
209 if (enabled)
210 {
211 if (sIsAdding)
212 {
213 if (sIsWhitelist)
214 {
215 add_text = "Enter the domain/url to add to the white list:";
216 }
217 else
218 {
219 add_text = "Enter the domain/url to add to the black list:";
220 }
221 }
222 else
223 {
224 add_text = "New Domain:";
225 }
226 }
227 childSetText("add_text", add_text);
228}
229
165void SLFloaterMediaFilter::setDirty() 230void SLFloaterMediaFilter::setDirty()
166{ 231{
167 if (sInstance) 232 if (sInstance)
@@ -208,23 +273,21 @@ void SLFloaterMediaFilter::onClearLists(void* data)
208 LLViewerParcelMedia::clearDomainFilterList(); 273 LLViewerParcelMedia::clearDomainFilterList();
209} 274}
210 275
276void SLFloaterMediaFilter::onShowIPs(void* data)
277{
278 sShowIPs = true;
279 setDirty();
280}
281
211void SLFloaterMediaFilter::onWhitelistAdd(void* data) 282void SLFloaterMediaFilter::onWhitelistAdd(void* data)
212{ 283{
213 if (!sInstance) 284 if (!sInstance)
214 { 285 {
215 return; 286 return;
216 } 287 }
217 sInstance->childDisable("clear_lists");
218 sInstance->childDisable("blacklist_list");
219 sInstance->childDisable("whitelist_list");
220 sInstance->childDisable("remove_whitelist");
221 sInstance->childDisable("add_whitelist");
222 sInstance->childDisable("remove_blacklist");
223 sInstance->childDisable("add_blacklist");
224 sInstance->childEnable("input_domain");
225 sInstance->childEnable("commit_domain");
226 sInstance->childSetText("add_text", std::string("Enter the domain/url to add to the white list:"));
227 sIsWhitelist = true; 288 sIsWhitelist = true;
289 sIsAdding = true;
290 sInstance->updateWidgets();
228} 291}
229 292
230void SLFloaterMediaFilter::onWhitelistRemove(void* data) 293void SLFloaterMediaFilter::onWhitelistRemove(void* data)
@@ -238,6 +301,12 @@ void SLFloaterMediaFilter::onWhitelistRemove(void* data)
238 if (selected) 301 if (selected)
239 { 302 {
240 std::string domain = sInstance->mWhitelistSLC->getSelectedItemLabel(); 303 std::string domain = sInstance->mWhitelistSLC->getSelectedItemLabel();
304 size_t pos = domain.find(' ');
305 if (pos != std::string::npos)
306 {
307 domain = domain.substr(0, pos);
308 }
309
241 LLViewerParcelMedia::sAllowedMedia.erase(domain); 310 LLViewerParcelMedia::sAllowedMedia.erase(domain);
242 311
243 for (S32 i = 0; i < (S32)LLViewerParcelMedia::sMediaFilterList.size(); i++) 312 for (S32 i = 0; i < (S32)LLViewerParcelMedia::sMediaFilterList.size(); i++)
@@ -245,11 +314,32 @@ void SLFloaterMediaFilter::onWhitelistRemove(void* data)
245 if (LLViewerParcelMedia::sMediaFilterList[i]["domain"].asString() == domain) 314 if (LLViewerParcelMedia::sMediaFilterList[i]["domain"].asString() == domain)
246 { 315 {
247 LLViewerParcelMedia::sMediaFilterList.erase(i); 316 LLViewerParcelMedia::sMediaFilterList.erase(i);
248 LLViewerParcelMedia::saveDomainFilterList();
249 break; 317 break;
250 } 318 }
251 } 319 }
252 320
321 if (sInstance->childGetValue("match_ip") && domain.find('/') == std::string::npos)
322 {
323 LLHost host;
324 host.setHostByName(domain);
325 std::string ip = host.getIPString();
326
327 if (ip != domain)
328 {
329 LLViewerParcelMedia::sAllowedMedia.erase(ip);
330
331 for (S32 i = 0; i < (S32)LLViewerParcelMedia::sMediaFilterList.size(); i++)
332 {
333 if (LLViewerParcelMedia::sMediaFilterList[i]["domain"].asString() == ip)
334 {
335 LLViewerParcelMedia::sMediaFilterList.erase(i);
336 break;
337 }
338 }
339 }
340 }
341
342 LLViewerParcelMedia::saveDomainFilterList();
253 setDirty(); 343 setDirty();
254 } 344 }
255} 345}
@@ -260,17 +350,9 @@ void SLFloaterMediaFilter::onBlacklistAdd(void* data)
260 { 350 {
261 return; 351 return;
262 } 352 }
263 sInstance->childDisable("clear_lists");
264 sInstance->childDisable("blacklist_list");
265 sInstance->childDisable("whitelist_list");
266 sInstance->childDisable("remove_whitelist");
267 sInstance->childDisable("add_whitelist");
268 sInstance->childDisable("remove_blacklist");
269 sInstance->childDisable("add_blacklist");
270 sInstance->childEnable("input_domain");
271 sInstance->childEnable("commit_domain");
272 sInstance->childSetText("add_text", std::string("Enter the domain/url to add to the black list:"));
273 sIsWhitelist = false; 353 sIsWhitelist = false;
354 sIsAdding = true;
355 sInstance->updateWidgets();
274} 356}
275 357
276void SLFloaterMediaFilter::onBlacklistRemove(void* data) 358void SLFloaterMediaFilter::onBlacklistRemove(void* data)
@@ -284,6 +366,12 @@ void SLFloaterMediaFilter::onBlacklistRemove(void* data)
284 if (selected) 366 if (selected)
285 { 367 {
286 std::string domain = sInstance->mBlacklistSLC->getSelectedItemLabel(); 368 std::string domain = sInstance->mBlacklistSLC->getSelectedItemLabel();
369 size_t pos = domain.find(' ');
370 if (pos != std::string::npos)
371 {
372 domain = domain.substr(0, pos);
373 }
374
287 LLViewerParcelMedia::sDeniedMedia.erase(domain); 375 LLViewerParcelMedia::sDeniedMedia.erase(domain);
288 376
289 for (S32 i = 0; i < (S32)LLViewerParcelMedia::sMediaFilterList.size(); i++) 377 for (S32 i = 0; i < (S32)LLViewerParcelMedia::sMediaFilterList.size(); i++)
@@ -291,11 +379,32 @@ void SLFloaterMediaFilter::onBlacklistRemove(void* data)
291 if (LLViewerParcelMedia::sMediaFilterList[i]["domain"].asString() == domain) 379 if (LLViewerParcelMedia::sMediaFilterList[i]["domain"].asString() == domain)
292 { 380 {
293 LLViewerParcelMedia::sMediaFilterList.erase(i); 381 LLViewerParcelMedia::sMediaFilterList.erase(i);
294 LLViewerParcelMedia::saveDomainFilterList();
295 break; 382 break;
296 } 383 }
297 } 384 }
298 385
386 if (sInstance->childGetValue("match_ip") && domain.find('/') == std::string::npos)
387 {
388 LLHost host;
389 host.setHostByName(domain);
390 std::string ip = host.getIPString();
391
392 if (ip != domain)
393 {
394 LLViewerParcelMedia::sDeniedMedia.erase(ip);
395
396 for (S32 i = 0; i < (S32)LLViewerParcelMedia::sMediaFilterList.size(); i++)
397 {
398 if (LLViewerParcelMedia::sMediaFilterList[i]["domain"].asString() == ip)
399 {
400 LLViewerParcelMedia::sMediaFilterList.erase(i);
401 break;
402 }
403 }
404 }
405 }
406
407 LLViewerParcelMedia::saveDomainFilterList();
299 setDirty(); 408 setDirty();
300 } 409 }
301} 410}
@@ -308,6 +417,10 @@ void SLFloaterMediaFilter::onCommitDomain(void* data)
308 } 417 }
309 std::string domain = sInstance->childGetText("input_domain"); 418 std::string domain = sInstance->childGetText("input_domain");
310 domain = LLViewerParcelMedia::extractDomain(domain); 419 domain = LLViewerParcelMedia::extractDomain(domain);
420 LLHost host;
421 host.setHostByName(domain);
422 std::string ip = host.getIPString();
423 bool match_ip = (sInstance->childGetValue("match_ip") && ip != domain && domain.find('/') == std::string::npos);
311 424
312 if (!domain.empty()) 425 if (!domain.empty())
313 { 426 {
@@ -318,7 +431,18 @@ void SLFloaterMediaFilter::onCommitDomain(void* data)
318 if (LLViewerParcelMedia::sMediaFilterList[i]["domain"].asString() == domain) 431 if (LLViewerParcelMedia::sMediaFilterList[i]["domain"].asString() == domain)
319 { 432 {
320 LLViewerParcelMedia::sMediaFilterList.erase(i); 433 LLViewerParcelMedia::sMediaFilterList.erase(i);
321 break; 434 }
435 }
436 if (match_ip)
437 {
438 LLViewerParcelMedia::sDeniedMedia.erase(ip);
439 LLViewerParcelMedia::sAllowedMedia.erase(ip);
440 for (S32 i = 0; i < (S32)LLViewerParcelMedia::sMediaFilterList.size(); i++)
441 {
442 if (LLViewerParcelMedia::sMediaFilterList[i]["domain"].asString() == ip)
443 {
444 LLViewerParcelMedia::sMediaFilterList.erase(i);
445 }
322 } 446 }
323 } 447 }
324 LLSD newmedia; 448 LLSD newmedia;
@@ -332,19 +456,33 @@ void SLFloaterMediaFilter::onCommitDomain(void* data)
332 newmedia["action"] = "deny"; 456 newmedia["action"] = "deny";
333 } 457 }
334 LLViewerParcelMedia::sMediaFilterList.append(newmedia); 458 LLViewerParcelMedia::sMediaFilterList.append(newmedia);
459 if (match_ip)
460 {
461 newmedia["domain"] = ip;
462 LLViewerParcelMedia::sMediaFilterList.append(newmedia);
463 }
335 LLViewerParcelMedia::saveDomainFilterList(); 464 LLViewerParcelMedia::saveDomainFilterList();
336 } 465 }
337 466
338 sInstance->childEnable("clear_lists");
339 sInstance->childEnable("blacklist_list");
340 sInstance->childEnable("whitelist_list");
341 sInstance->childEnable("remove_whitelist");
342 sInstance->childEnable("add_whitelist");
343 sInstance->childEnable("remove_blacklist");
344 sInstance->childEnable("add_blacklist");
345 sInstance->childDisable("input_domain");
346 sInstance->childDisable("commit_domain");
347 sInstance->childSetText("add_text", std::string("New domain:"));
348 sInstance->childSetText("input_domain", std::string("")); 467 sInstance->childSetText("input_domain", std::string(""));
468 sIsAdding = false;
469 setDirty();
470}
471
472//static
473void SLFloaterMediaFilter::onCancelDomain(void* data)
474{
475 if (!sInstance)
476 {
477 return;
478 }
479 sInstance->childSetText("input_domain", std::string(""));
480 sIsAdding = false;
481 setDirty();
482}
483
484//static
485void SLFloaterMediaFilter::onMediaEnableFilterChanged(const LLSD& newvalue)
486{
349 setDirty(); 487 setDirty();
350} 488}
diff --git a/linden/indra/newview/slfloatermediafilter.h b/linden/indra/newview/slfloatermediafilter.h
index 0f900be..9067c74 100644
--- a/linden/indra/newview/slfloatermediafilter.h
+++ b/linden/indra/newview/slfloatermediafilter.h
@@ -38,6 +38,7 @@
38 38
39class LLScrollListCtrl; 39class LLScrollListCtrl;
40class LLButton; 40class LLButton;
41class LLSD;
41 42
42class SLFloaterMediaFilter : public LLFloater 43class SLFloaterMediaFilter : public LLFloater
43{ 44{
@@ -52,14 +53,22 @@ public:
52 static void toggleInstance(); 53 static void toggleInstance();
53 54
54 static void onClearLists(void*); 55 static void onClearLists(void*);
56 static void onShowIPs(void*);
55 static void onWhitelistAdd(void*); 57 static void onWhitelistAdd(void*);
56 static void onWhitelistRemove(void*); 58 static void onWhitelistRemove(void*);
57 static void onBlacklistAdd(void*); 59 static void onBlacklistAdd(void*);
58 static void onBlacklistRemove(void*); 60 static void onBlacklistRemove(void*);
59 static void onCommitDomain(void*); 61 static void onCommitDomain(void*);
62 static void onCancelDomain(void*);
63 static void onMediaEnableFilterChanged(const LLSD& newvalue);
64
65private:
66 void updateWidgets();
60 67
61private: 68private:
62 static bool sIsWhitelist; 69 static bool sIsWhitelist;
70 static bool sShowIPs;
71 static bool sIsAdding;
63 LLScrollListCtrl* mWhitelistSLC; 72 LLScrollListCtrl* mWhitelistSLC;
64 LLScrollListCtrl* mBlacklistSLC; 73 LLScrollListCtrl* mBlacklistSLC;
65 bool mIsDirty; 74 bool mIsDirty;