diff --git a/indra/newview/llagentlistener.cpp b/indra/newview/llagentlistener.cpp index 7887184a11b01ed3968a6c4f5298c1e7d0caf0bf..5a720af038ff1f2d66e783315267d7d67a1d1765 100644 --- a/indra/newview/llagentlistener.cpp +++ b/indra/newview/llagentlistener.cpp @@ -35,6 +35,7 @@ #include "llcommandhandler.h" #include "llslurl.h" #include "llurldispatcher.h" +#include "llviewernetwork.h" #include "llviewerobject.h" #include "llviewerobjectlist.h" #include "llviewerregion.h" @@ -148,7 +149,7 @@ void LLAgentListener::requestTeleport(LLSD const & event_data) const params.append(event_data["x"]); params.append(event_data["y"]); params.append(event_data["z"]); - LLCommandDispatcher::dispatch("teleport", params, LLSD(), NULL, "clicked", true); + LLCommandDispatcher::dispatch("teleport", params, LLSD(), LLGridManager::getInstance()->getGrid(), NULL, "clicked", true); // *TODO - lookup other LLCommandHandlers for "agent", "classified", "event", "group", "floater", "parcel", "login", login_refresh", "balance", "chat" // should we just compose LLCommandHandler and LLDispatchListener? } diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 07d6efd2fae5a6e60afe0a49d2d66d9e910c3df4..d0fad07f1c5f813d4afd1d5c75f683148ab57f1f 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -147,7 +147,10 @@ class LLAppearanceHandler : public LLCommandHandler // requests will be throttled from a non-trusted browser LLAppearanceHandler() : LLCommandHandler("appearance", UNTRUSTED_THROTTLE) {} - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& params, + const LLSD& query_map, + const std::string& grid, + LLMediaCtrl* web) { // support secondlife:///app/appearance/show, but for now we just // make all secondlife:///app/appearance SLapps behave this way @@ -4472,8 +4475,10 @@ class LLWearFolderHandler : public LLCommandHandler // not allowed from outside the app LLWearFolderHandler() : LLCommandHandler("wear_folder", UNTRUSTED_BLOCK) { } - bool handle(const LLSD& tokens, const LLSD& query_map, - LLMediaCtrl* web) + bool handle(const LLSD& tokens, + const LLSD& query_map, + const std::string& grid, + LLMediaCtrl* web) { LLSD::UUID folder_uuid; diff --git a/indra/newview/llbuycurrencyhtml.cpp b/indra/newview/llbuycurrencyhtml.cpp index 7ad06f8eaa41a089c6a54b7bc3ee4aac7a522f87..37de89a48b7ce45be5fa5471166470033b620b60 100644 --- a/indra/newview/llbuycurrencyhtml.cpp +++ b/indra/newview/llbuycurrencyhtml.cpp @@ -43,7 +43,7 @@ class LLBuyCurrencyHTMLHandler : // requests will be throttled from a non-trusted browser LLBuyCurrencyHTMLHandler() : LLCommandHandler( "buycurrencyhtml", UNTRUSTED_THROTTLE) {} - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& params, const LLSD& query_map, const std::string& grid, LLMediaCtrl* web) { std::string action( "" ); if ( params.size() >= 1 ) diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 9a608fba8e4c24be15b1d4db9161f947bcfe3f58..43dc10ef5f49637c59b6bc882f9eec50cd1c0abd 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -82,7 +82,7 @@ class LLObjectIMHandler : public LLCommandHandler // requests will be throttled from a non-trusted browser LLObjectIMHandler() : LLCommandHandler("objectim", UNTRUSTED_THROTTLE) {} - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& params, const LLSD& query_map, const std::string& grid, LLMediaCtrl* web) { if (params.size() < 1) { diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp index 1c22e055bb8f43a37fdefa970e5e4c95c7dcdcd8..dc2cc57f0fcbf126575e288289587ac3eadf5404 100644 --- a/indra/newview/llchatitemscontainerctrl.cpp +++ b/indra/newview/llchatitemscontainerctrl.cpp @@ -57,7 +57,7 @@ class LLObjectHandler : public LLCommandHandler public: LLObjectHandler() : LLCommandHandler("object", UNTRUSTED_BLOCK) { } - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& params, const LLSD& query_map, const std::string& grid, LLMediaCtrl* web) { if (params.size() < 2) return false; diff --git a/indra/newview/llcommanddispatcherlistener.cpp b/indra/newview/llcommanddispatcherlistener.cpp index 586f45fd8f41c8b7dc028c4f2e667cce9b71b3d0..1b85c09071a20fc2471ff683c8e5f2a49519eb80 100644 --- a/indra/newview/llcommanddispatcherlistener.cpp +++ b/indra/newview/llcommanddispatcherlistener.cpp @@ -64,7 +64,7 @@ void LLCommandDispatcherListener::dispatch(const LLSD& params) const // But for testing, allow a caller to specify untrusted. trusted_browser = params["trusted"].asBoolean(); } - LLCommandDispatcher::dispatch(params["cmd"], params["params"], params["query"], NULL, + LLCommandDispatcher::dispatch(params["cmd"], params["params"], params["query"], "", NULL, "clicked", trusted_browser); } diff --git a/indra/newview/llcommandhandler.cpp b/indra/newview/llcommandhandler.cpp index 74f37961c7420043b19edba9df9f6714b98a0225..e774a9390a64a9e835abfd8cffc1eae32d16f74c 100644 --- a/indra/newview/llcommandhandler.cpp +++ b/indra/newview/llcommandhandler.cpp @@ -60,6 +60,7 @@ class LLCommandHandlerRegistry bool dispatch(const std::string& cmd, const LLSD& params, const LLSD& query_map, + const std::string& grid, LLMediaCtrl* web, const std::string& nav_type, bool trusted_browser); @@ -96,6 +97,7 @@ void LLCommandHandlerRegistry::add(const char* cmd, bool LLCommandHandlerRegistry::dispatch(const std::string& cmd, const LLSD& params, const LLSD& query_map, + const std::string& grid, LLMediaCtrl* web, const std::string& nav_type, bool trusted_browser) @@ -163,7 +165,7 @@ bool LLCommandHandlerRegistry::dispatch(const std::string& cmd, } } if (!info.mHandler) return false; - return info.mHandler->handle(params, query_map, web); + return info.mHandler->handle(params, query_map, grid, web); } void LLCommandHandlerRegistry::notifySlurlBlocked() @@ -218,12 +220,13 @@ LLCommandHandler::~LLCommandHandler() bool LLCommandDispatcher::dispatch(const std::string& cmd, const LLSD& params, const LLSD& query_map, + const std::string& grid, LLMediaCtrl* web, const std::string& nav_type, bool trusted_browser) { return LLCommandHandlerRegistry::instance().dispatch( - cmd, params, query_map, web, nav_type, trusted_browser); + cmd, params, query_map, grid, web, nav_type, trusted_browser); } static std::string lookup(LLCommandHandler::EUntrustedAccess value); diff --git a/indra/newview/llcommandhandler.h b/indra/newview/llcommandhandler.h index 763e3ee51f3658026305dcdce18e49a8bdf516d1..c7a7a18c7de40241b4730e22517c63c2d9a9ce71 100644 --- a/indra/newview/llcommandhandler.h +++ b/indra/newview/llcommandhandler.h @@ -42,7 +42,7 @@ class LLFooHandler : public LLCommandHandler LLFooHandler() : LLCommandHandler("foo", UNTRUSTED_BLOCK) { } // Your code here - bool handle(const LLSD& tokens, const LLSD& query_map, + bool handle(const LLSD& tokens, const LLSD& query_map, const std::string& grid, LLMediaCtrl* web) { if (tokens.size() < 1) return false; @@ -88,6 +88,7 @@ class LLCommandHandler virtual bool handle(const LLSD& params, const LLSD& query_map, + const std::string& grid, LLMediaCtrl* web) = 0; // For URL secondlife:///app/foo/bar/baz?cat=1&dog=2 // @params - array of "bar", "baz", possibly empty @@ -104,6 +105,7 @@ class LLCommandDispatcher static bool dispatch(const std::string& cmd, const LLSD& params, const LLSD& query_map, + const std::string& grid, LLMediaCtrl* web, const std::string& nav_type, bool trusted_browser); diff --git a/indra/newview/lleventnotifier.cpp b/indra/newview/lleventnotifier.cpp index f1a44a68c902bc14a6b3d1796fc7f17bc04a2a1c..788b61b381244d01dd15df1f46fdfaff4ffa5905 100644 --- a/indra/newview/lleventnotifier.cpp +++ b/indra/newview/lleventnotifier.cpp @@ -43,8 +43,10 @@ class LLEventHandler : public LLCommandHandler public: // requires trusted browser to trigger LLEventHandler() : LLCommandHandler("event", UNTRUSTED_THROTTLE) { } - bool handle(const LLSD& params, const LLSD& query_map, - LLMediaCtrl* web) + bool handle(const LLSD& params, + const LLSD& query_map, + const std::string& grid, + LLMediaCtrl* web) { if (params.size() < 2) { diff --git a/indra/newview/llfloaterexperienceprofile.cpp b/indra/newview/llfloaterexperienceprofile.cpp index a99a096ea7bcbf36f73c894db7fad749f09e4973..f6afdd29fbafe4afe677bae40856786bb7855359 100644 --- a/indra/newview/llfloaterexperienceprofile.cpp +++ b/indra/newview/llfloaterexperienceprofile.cpp @@ -92,8 +92,10 @@ class LLExperienceHandler : public LLCommandHandler public: LLExperienceHandler() : LLCommandHandler("experience", UNTRUSTED_THROTTLE) { } - bool handle(const LLSD& params, const LLSD& query_map, - LLMediaCtrl* web) + bool handle(const LLSD& params, + const LLSD& query_map, + const std::string& grid, + LLMediaCtrl* web) { if(params.size() != 2 || params[1].asString() != "profile") return false; diff --git a/indra/newview/llfloaterhandler.cpp b/indra/newview/llfloaterhandler.cpp index 8ebb14149c96240ef13aa990ca37f2bd7900805e..b66049de7f1bd4d23bf53ab51d1e32a77a1a4df6 100644 --- a/indra/newview/llfloaterhandler.cpp +++ b/indra/newview/llfloaterhandler.cpp @@ -49,7 +49,7 @@ LLFloater* get_parent_floater(LLView* view) } -bool LLFloaterHandler::handle(const LLSD ¶ms, const LLSD &query_map, LLMediaCtrl *web) +bool LLFloaterHandler::handle(const LLSD ¶ms, const LLSD &query_map, const std::string& grid, LLMediaCtrl *web) { if (params.size() < 1) return false; LLFloater* floater = NULL; diff --git a/indra/newview/llfloaterhandler.h b/indra/newview/llfloaterhandler.h index 5915642d6671eb9f905867fe4d3c79e049733661..959c9722752be944b39ab145511486f7925d0771 100644 --- a/indra/newview/llfloaterhandler.h +++ b/indra/newview/llfloaterhandler.h @@ -33,7 +33,7 @@ class LLFloaterHandler { public: LLFloaterHandler() : LLCommandHandler("floater", UNTRUSTED_BLOCK) { } - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web); + bool handle(const LLSD& params, const LLSD& query_map, const std::string& grid, LLMediaCtrl* web); }; #endif diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp index f1807f1c5bea465b1ce60e4cd19ea4424aed46c3..f63268660c21ad4445c9f785e01e22c52d638b9f 100644 --- a/indra/newview/llfloaterimnearbychat.cpp +++ b/indra/newview/llfloaterimnearbychat.cpp @@ -901,8 +901,10 @@ class LLChatCommandHandler : public LLCommandHandler LLChatCommandHandler() : LLCommandHandler("chat", UNTRUSTED_BLOCK) { } // Your code here - bool handle(const LLSD& tokens, const LLSD& query_map, - LLMediaCtrl* web) + bool handle(const LLSD& tokens, + const LLSD& query_map, + const std::string& grid, + LLMediaCtrl* web) { bool retval = false; // Need at least 2 tokens to have a valid message. diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index 7e6af45515ec53f7ec6a26bee3f74f7877b9902b..37ae80fa8fc0c1b343d16b2121c2d6a4cf494d4f 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -46,7 +46,7 @@ class LLSearchHandler : public LLCommandHandler public: // requires trusted browser to trigger LLSearchHandler() : LLCommandHandler("search", UNTRUSTED_CLICK_ONLY) { } - bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& tokens, const LLSD& query_map, const std::string& grid, LLMediaCtrl* web) { if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnableSearch")) { diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 704abd269fa7e109214d6a305895a3c27fe7c2b9..8f3ec8af0537994b2f4b0cf6cb47ae5c4f918265 100755 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -124,8 +124,10 @@ class LLWorldMapHandler : public LLCommandHandler // requires trusted browser to trigger LLWorldMapHandler() : LLCommandHandler("worldmap", UNTRUSTED_CLICK_ONLY ) { } - bool handle(const LLSD& params, const LLSD& query_map, - LLMediaCtrl* web) + bool handle(const LLSD& params, + const LLSD& query_map, + const std::string& grid, + LLMediaCtrl* web) { if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnableWorldMap")) { @@ -163,7 +165,10 @@ class LLMapTrackAvatarHandler : public LLCommandHandler { } - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& params, + const LLSD& query_map, + const std::string& grid, + LLMediaCtrl* web) { if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnableWorldMap")) { diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index be52e280e1935286666118a585c32c2282057e92..85b8ff0570d7abe4f946edf7db235ac6c90829a0 100644 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -78,8 +78,10 @@ class LLGroupHandler : public LLCommandHandler return true; } - bool handle(const LLSD& tokens, const LLSD& query_map, - LLMediaCtrl* web) + bool handle(const LLSD& tokens, + const LLSD& query_map, + const std::string& grid, + LLMediaCtrl* web) { if (LLStartUp::getStartupState() < STATE_STARTED) { diff --git a/indra/newview/llloginhandler.cpp b/indra/newview/llloginhandler.cpp index 22cedf450eb9a009c2fe422573ba51ad9d634d80..92e341ce939868eab618d82e5435c369d0b3a0c2 100644 --- a/indra/newview/llloginhandler.cpp +++ b/indra/newview/llloginhandler.cpp @@ -87,6 +87,7 @@ void LLLoginHandler::parse(const LLSD& queryMap) bool LLLoginHandler::handle(const LLSD& tokens, const LLSD& query_map, + const std::string& grid, LLMediaCtrl* web) { // do nothing if we are already logged in diff --git a/indra/newview/llloginhandler.h b/indra/newview/llloginhandler.h index 1f2eacd094e1c7e27d0efaf021b5659581dd1503..2579341dbf992b14691f410f0c0e19c5a453816d 100644 --- a/indra/newview/llloginhandler.h +++ b/indra/newview/llloginhandler.h @@ -35,7 +35,7 @@ class LLLoginHandler : public LLCommandHandler public: // allow from external browsers LLLoginHandler() : LLCommandHandler("login", UNTRUSTED_ALLOW) { } - /*virtual*/ bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web); + /*virtual*/ bool handle(const LLSD& tokens, const LLSD& query_map, const std::string& grid, LLMediaCtrl* web); // Fill in our internal fields from a SLURL like // secondlife:///app/login?first=Bob&last=Dobbs diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 0103bf628a9d69aef9365b6ebcfbbaa581cf133a..1b4684d0735156104006b650def937d690642c18 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -1665,7 +1665,7 @@ class LLMetricSystemHandler : public LLCommandHandler public: LLMetricSystemHandler() : LLCommandHandler("metricsystem", UNTRUSTED_CLICK_ONLY) { } - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& params, const LLSD& query_map, const std::string& grid, LLMediaCtrl* web) { // change height units TRUE for meters and FALSE for feet BOOL new_value = (gSavedSettings.getBOOL("HeightUnits") == FALSE) ? TRUE : FALSE; diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index b14fdbf38e8601a0ac9318d8ced512c5a477ab9b..8f1e57e44ceb4532f3edcf1547659a3c5cf203bb 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -97,7 +97,7 @@ class LLLoginLocationAutoHandler : public LLCommandHandler public: // don't allow from external browsers LLLoginLocationAutoHandler() : LLCommandHandler("location_login", UNTRUSTED_BLOCK) { } - bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& tokens, const LLSD& query_map, const std::string& grid, LLMediaCtrl* web) { if (LLStartUp::getStartupState() < STATE_LOGIN_CLEANUP) { diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 0f00231643c63dc3dad339e84469492568de347f..1d5ed93c4d896f5d3874fef35150d4d0eca48e33 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -91,8 +91,10 @@ class LLParcelHandler : public LLCommandHandler public: // requires trusted browser to trigger LLParcelHandler() : LLCommandHandler("parcel", UNTRUSTED_THROTTLE) { } - bool handle(const LLSD& params, const LLSD& query_map, - LLMediaCtrl* web) + bool handle(const LLSD& params, + const LLSD& query_map, + const std::string& grid, + LLMediaCtrl* web) { if (params.size() < 2) { diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 708ff26ced83648091bc4d6dc37398bda9fd7fdc..79b7ed821667ac28d603ce117c271fbc6984c63d 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -460,8 +460,10 @@ class LLProfileHandler : public LLCommandHandler // requires trusted browser to trigger LLProfileHandler() : LLCommandHandler("profile", UNTRUSTED_THROTTLE) { } - bool handle(const LLSD& params, const LLSD& query_map, - LLMediaCtrl* web) + bool handle(const LLSD& params, + const LLSD& query_map, + const std::string& grid, + LLMediaCtrl* web) { if (params.size() < 1) return false; std::string agent_name = params[0]; @@ -508,8 +510,10 @@ class LLAgentHandler : public LLCommandHandler return false; } - bool handle(const LLSD& params, const LLSD& query_map, - LLMediaCtrl* web) + bool handle(const LLSD& params, + const LLSD& query_map, + const std::string& grid, + LLMediaCtrl* web) { if (params.size() < 2) return false; LLUUID avatar_id; diff --git a/indra/newview/llpanelprofileclassifieds.cpp b/indra/newview/llpanelprofileclassifieds.cpp index 1ff12b4f3781dfce2d61bfd0d0fffee2e62b434c..dec6cfd83b9ca900d93b8fc1e473e2e7ba48a24f 100644 --- a/indra/newview/llpanelprofileclassifieds.cpp +++ b/indra/newview/llpanelprofileclassifieds.cpp @@ -106,7 +106,7 @@ class LLClassifiedHandler : public LLCommandHandler, public LLAvatarPropertiesOb return true; } - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& params, const LLSD& query_map, const std::string& grid, LLMediaCtrl* web) { if (LLStartUp::getStartupState() < STATE_STARTED) { diff --git a/indra/newview/llpanelprofilepicks.cpp b/indra/newview/llpanelprofilepicks.cpp index 45d0252e4fef0d36ab3e4b01cc2c5ace18410aba..274d42f7eb3ce1ed9bebc67a3d797578d5b1ece4 100644 --- a/indra/newview/llpanelprofilepicks.cpp +++ b/indra/newview/llpanelprofilepicks.cpp @@ -87,8 +87,10 @@ class LLPickHandler : public LLCommandHandler return true; } - bool handle(const LLSD& params, const LLSD& query_map, - LLMediaCtrl* web) + bool handle(const LLSD& params, + const LLSD& query_map, + const std::string& grid, + LLMediaCtrl* web) { if (LLStartUp::getStartupState() < STATE_STARTED) { diff --git a/indra/newview/llshareavatarhandler.cpp b/indra/newview/llshareavatarhandler.cpp index 142e00c3f7e5203437cc1848cd51e5ccfd49edf7..8c5ebb75efa907067a281d3fb4800dd72f25ce23 100644 --- a/indra/newview/llshareavatarhandler.cpp +++ b/indra/newview/llshareavatarhandler.cpp @@ -38,7 +38,7 @@ class LLShareWithAvatarHandler : public LLCommandHandler { } - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& params, const LLSD& query_map, const std::string& grid, LLMediaCtrl* web) { if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnableAvatarShare")) { diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 0a87b14e17fd094fc75f3cb33061da970fdca9d5..1ef5d1c50b987c1a2233c90bfddfe1c5f9bd6f1c 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -729,7 +729,7 @@ class LLBalanceHandler : public LLCommandHandler public: // Requires "trusted" browser/URL source LLBalanceHandler() : LLCommandHandler("balance", UNTRUSTED_BLOCK) { } - bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& tokens, const LLSD& query_map, const std::string& grid, LLMediaCtrl* web) { if (tokens.size() == 1 && tokens[0].asString() == "request") diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp index 7c92e7ef98ac802a2a2772adc4c2427dce1609e2..6fc870f8901d09b4a70195a56de49f8f998de88f 100644 --- a/indra/newview/llurldispatcher.cpp +++ b/indra/newview/llurldispatcher.cpp @@ -97,6 +97,8 @@ class LLURLDispatcherImpl // Called by LLWorldMap when a region name has been resolved to a // location in-world, used by places-panel display. + static bool handleGrid(const LLSLURL& slurl); + friend class LLTeleportHandler; }; @@ -155,7 +157,7 @@ bool LLURLDispatcherImpl::dispatchApp(const LLSLURL& slurl, LL_INFOS() << "cmd: " << slurl.getAppCmd() << " path: " << slurl.getAppPath() << " query: " << slurl.getAppQuery() << LL_ENDL; const LLSD& query_map = LLURI::queryMap(slurl.getAppQuery()); bool handled = LLCommandDispatcher::dispatch( - slurl.getAppCmd(), slurl.getAppPath(), query_map, web, nav_type, trusted_browser); + slurl.getAppCmd(), slurl.getAppPath(), query_map, slurl.getGrid(), web, nav_type, trusted_browser); // alert if we didn't handle this secondlife:///app/ SLURL // (but still return true because it is a valid app SLURL) @@ -184,6 +186,11 @@ bool LLURLDispatcherImpl::dispatchRegion(const LLSLURL& slurl, const std::string return true; } + if (!handleGrid(slurl)) + { + return true; + } + // Request a region handle by name LLWorldMapMessage::getInstance()->sendNamedRegionRequest(slurl.getRegion(), LLURLDispatcherImpl::regionNameCallback, @@ -202,31 +209,39 @@ void LLURLDispatcherImpl::regionNameCallback(U64 region_handle, const LLSLURL& s } } +bool LLURLDispatcherImpl::handleGrid(const LLSLURL& slurl) +{ + if (LLGridManager::getInstance()->getGrid(slurl.getGrid()) + != LLGridManager::getInstance()->getGrid()) + { + LLSD args; + args["SLURL"] = slurl.getLocationString(); + args["CURRENT_GRID"] = LLGridManager::getInstance()->getGridLabel(); + std::string grid_label = + LLGridManager::getInstance()->getGridLabel(slurl.getGrid()); + + if (!grid_label.empty()) + { + args["GRID"] = grid_label; + } + else + { + args["GRID"] = slurl.getGrid(); + } + LLNotificationsUtil::add("CantTeleportToGrid", args); + return false; + } + return true; +} + /* static */ void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const LLSLURL& slurl, const LLUUID& snapshot_id, bool teleport) { - - // we can't teleport cross grid at this point - if( LLGridManager::getInstance()->getGrid(slurl.getGrid()) - != LLGridManager::getInstance()->getGrid()) - { - LLSD args; - args["SLURL"] = slurl.getLocationString(); - args["CURRENT_GRID"] = LLGridManager::getInstance()->getGridLabel(); - std::string grid_label = - LLGridManager::getInstance()->getGridLabel(slurl.getGrid()); - - if(!grid_label.empty()) - { - args["GRID"] = grid_label; - } - else - { - args["GRID"] = slurl.getGrid(); - } - LLNotificationsUtil::add("CantTeleportToGrid", args); - return; - } + if (!handleGrid(slurl)) + { + // we can't teleport cross grid at this point + return; + } LLVector3d global_pos = from_region_handle(region_handle); global_pos += LLVector3d(slurl.getPosition()); @@ -274,8 +289,10 @@ class LLTeleportHandler : public LLCommandHandler, public LLEventAPI &LLTeleportHandler::from_event); } - bool handle(const LLSD& tokens, const LLSD& query_map, - LLMediaCtrl* web) + bool handle(const LLSD& tokens, + const LLSD& query_map, + const std::string& grid, + LLMediaCtrl* web) { // construct a "normal" SLURL, resolve the region to // a global position, and teleport to it @@ -297,7 +314,7 @@ class LLTeleportHandler : public LLCommandHandler, public LLEventAPI LLSD payload; payload["region_name"] = region_name; - payload["callback_url"] = LLSLURL(region_name, coords).getSLURLString(); + payload["callback_url"] = LLSLURL(grid, region_name, coords).getSLURLString(); LLNotificationsUtil::add("TeleportViaSLAPP", args, payload); return true; diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index c0398372b43e43ee53238c57c33987bc898df587..23b79993998fc22a99cd98c21bf4a5d4d5e74b85 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -270,6 +270,7 @@ class LLFloaterOpenHandler : public LLCommandHandler bool handle( const LLSD& params, const LLSD& query_map, + const std::string& grid, LLMediaCtrl* web) override { if (params.size() != 1) diff --git a/indra/newview/llviewerhelp.cpp b/indra/newview/llviewerhelp.cpp index 04c2e27c9d0bde394c9bdfc95778b999e9e2f484..b03942db9f8d91c42d6b22662ebd16eecd6d973f 100644 --- a/indra/newview/llviewerhelp.cpp +++ b/indra/newview/llviewerhelp.cpp @@ -45,7 +45,7 @@ class LLHelpHandler : public LLCommandHandler // requests will be throttled from a non-trusted browser LLHelpHandler() : LLCommandHandler("help", UNTRUSTED_THROTTLE) {} - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& params, const LLSD& query_map, const std::string& grid, LLMediaCtrl* web) { LLViewerHelp* vhelp = LLViewerHelp::getInstance(); if (! vhelp) diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 50252556debd20f594704fa462c2ad5777d1dc48..793eb5673495b9585bc824a58aa501163fc66a7c 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -234,8 +234,10 @@ class LLInventoryHandler : public LLCommandHandler // requires trusted browser to trigger LLInventoryHandler() : LLCommandHandler("inventory", UNTRUSTED_CLICK_ONLY) { } - bool handle(const LLSD& params, const LLSD& query_map, - LLMediaCtrl* web) + bool handle(const LLSD& params, + const LLSD& query_map, + const std::string& grid, + LLMediaCtrl* web) { if (params.size() < 1) { diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index ad7321ca4be7a2cfd38395bf2c92f64712394a3f..e122baadce23aae92f72e1e80fd6ecb4e3594946 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -131,8 +131,8 @@ class LLRegionHandler : public LLCommandHandler public: // requests will be throttled from a non-trusted browser LLRegionHandler() : LLCommandHandler("region", UNTRUSTED_THROTTLE) {} - - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + + bool handle(const LLSD& params, const LLSD& query_map, const std::string& grid, LLMediaCtrl* web) { // make sure that we at least have a region name int num_params = params.size(); @@ -143,6 +143,10 @@ class LLRegionHandler : public LLCommandHandler // build a secondlife://{PLACE} SLurl from this SLapp std::string url = "secondlife://"; + if (!grid.empty()) + { + url += grid + "/secondlife/"; + } boost::regex name_rx("[A-Za-z0-9()_%]+"); boost::regex coord_rx("[0-9]+"); for (int i = 0; i < num_params; i++) diff --git a/indra/newview/llvoicecallhandler.cpp b/indra/newview/llvoicecallhandler.cpp index 1e993d13843aaf3af2c93fa95ebd55508ee0f36b..95e11abd829c6488871c6752eb97f443efdbbe05 100644 --- a/indra/newview/llvoicecallhandler.cpp +++ b/indra/newview/llvoicecallhandler.cpp @@ -38,7 +38,7 @@ class LLVoiceCallAvatarHandler : public LLCommandHandler { } - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& params, const LLSD& query_map, const std::string& grid, LLMediaCtrl* web) { if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnableVoiceCall")) { diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 6bb987ede4e329f5dc2eb1f4fc447c3324a12da2..bf96f0bbb4fb78bee5bd430ea31f71f192dc7922 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -53,7 +53,7 @@ class LLVoiceHandler : public LLCommandHandler // requests will be throttled from a non-trusted browser LLVoiceHandler() : LLCommandHandler("voice", UNTRUSTED_THROTTLE) {} - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& params, const LLSD& query_map, const std::string& grid, LLMediaCtrl* web) { if (params[0].asString() == "effects") { diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 6e994b4e68ad95060a476beb0b3026c1ff917ff2..b59bbaaa88d9161ded6de659193a475e0ace25d8 100755 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -50,6 +50,7 @@ #include "lltextureview.h" #include "lltracker.h" #include "llviewercamera.h" +#include "llviewernetwork.h" #include "llviewertexture.h" #include "llviewertexturelist.h" #include "llviewerregion.h" @@ -1829,7 +1830,7 @@ BOOL LLWorldMapView::handleDoubleClick( S32 x, S32 y, MASK mask ) // Invoke the event details floater if someone is clicking on an event. LLSD params(LLSD::emptyArray()); params.append(event_id); - LLCommandDispatcher::dispatch("event", params, LLSD(), NULL, "clicked", true); + LLCommandDispatcher::dispatch("event", params, LLSD(), LLGridManager::getInstance()->getGrid(), NULL, "clicked", true); break; } case MAP_ITEM_LAND_FOR_SALE: