// static bool LLURLDispatcherImpl::dispatchApp(const LLSLURL& slurl, const std::string& nav_type, bool right_mouse, LLMediaCtrl* web, bool trusted_browser) { llinfos << "cmd: " << slurl.getAppCmd() << " path: " << slurl.getAppPath() << " query: " << slurl.getAppQuery() << llendl; const LLSD& query_map = LLURI::queryMap(slurl.getAppQuery()); bool handled = LLCommandDispatcher::dispatch( slurl.getAppCmd(), slurl.getAppPath(), query_map, 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) if (! handled) { LLNotificationsUtil::add("UnsupportedCommandSLURL"); } return true; }
// static bool LLURLDispatcherImpl::dispatchApp(const LLSLURL& slurl, const std::string& nav_type, bool right_mouse, LLMediaCtrl* web, bool trusted_browser) { llinfos << "cmd: " << slurl.getAppCmd() << " path: " << slurl.getAppPath() << " query: " << slurl.getAppQuery() << llendl; const LLSD& query_map = LLURI::queryMap(slurl.getAppQuery()); // <FS:AW handle hop app teleports properly> // bool handled = LLCommandDispatcher::dispatch( // slurl.getAppCmd(), slurl.getAppPath(), query_map, web, nav_type, trusted_browser); LLSD path; #ifdef HAS_OPENSIM_SUPPORT // <FS:AW optional opensim support> if ("teleport" == slurl.getAppCmd()) { path = LLSD::emptyArray(); path.append(slurl.getGrid()); for(int i=0; slurl.getAppPath().size() > i; i++) { path.append(slurl.getAppPath()[i].asString()); } } else #endif // HAS_OPENSIM_SUPPORT // <FS:AW optional opensim support> { path = slurl.getAppPath(); } bool handled = LLCommandDispatcher::dispatch( slurl.getAppCmd(), path, query_map, web, nav_type, trusted_browser); // </FS:AW handle hop app teleports properly> // alert if we didn't handle this secondlife:///app/ SLURL // (but still return true because it is a valid app SLURL) if (! handled) { LLNotificationsUtil::add("UnsupportedCommandSLURL"); } return true; }
void slurlTestObject::test<1>() { LLGridManager::getInstance()->setGridChoice("util.agni.lindenlab.com"); LLSLURL slurl = LLSLURL(""); ensure_equals("null slurl", (int)slurl.getType(), LLSLURL::LAST_LOCATION); slurl = LLSLURL("http://slurl.com/secondlife/myregion"); ensure_equals("slurl.com slurl, region only - type", slurl.getType(), LLSLURL::LOCATION); ensure_equals("slurl.com slurl, region only", slurl.getSLURLString(), "http://maps.secondlife.com/secondlife/myregion/128/128/0"); slurl = LLSLURL("http://maps.secondlife.com/secondlife/myregion/1/2/3"); ensure_equals("maps.secondlife.com slurl, region + coords - type", slurl.getType(), LLSLURL::LOCATION); ensure_equals("maps.secondlife.com slurl, region + coords", slurl.getSLURLString(), "http://maps.secondlife.com/secondlife/myregion/1/2/3"); slurl = LLSLURL("secondlife://myregion"); ensure_equals("secondlife: slurl, region only - type", slurl.getType(), LLSLURL::LOCATION); ensure_equals("secondlife: slurl, region only", slurl.getSLURLString(), "http://maps.secondlife.com/secondlife/myregion/128/128/0"); slurl = LLSLURL("secondlife://myregion/1/2/3"); ensure_equals("secondlife: slurl, region + coords - type", slurl.getType(), LLSLURL::LOCATION); ensure_equals("secondlife slurl, region + coords", slurl.getSLURLString(), "http://maps.secondlife.com/secondlife/myregion/1/2/3"); slurl = LLSLURL("/myregion"); ensure_equals("/region slurl, region- type", slurl.getType(), LLSLURL::LOCATION); ensure_equals("/region slurl, region ", slurl.getSLURLString(), "http://maps.secondlife.com/secondlife/myregion/128/128/0"); slurl = LLSLURL("/myregion/1/2/3"); ensure_equals("/: slurl, region + coords - type", slurl.getType(), LLSLURL::LOCATION); ensure_equals("/ slurl, region + coords", slurl.getSLURLString(), "http://maps.secondlife.com/secondlife/myregion/1/2/3"); slurl = LLSLURL("my region/1/2/3"); ensure_equals(" slurl, region + coords - type", slurl.getType(), LLSLURL::LOCATION); ensure_equals(" slurl, region + coords", slurl.getSLURLString(), "http://maps.secondlife.com/secondlife/my%20region/1/2/3"); slurl = LLSLURL("https://my.grid.com/region/my%20region/1/2/3"); ensure_equals("grid slurl, region + coords - type", slurl.getType(), LLSLURL::LOCATION); ensure_equals("grid slurl, region + coords", slurl.getSLURLString(), "https://my.grid.com/region/my%20region/1/2/3"); slurl = LLSLURL("https://my.grid.com/region/my region"); ensure_equals("grid slurl, region + coords - type", slurl.getType(), LLSLURL::LOCATION); ensure_equals("grid slurl, region + coords", slurl.getSLURLString(), "https://my.grid.com/region/my%20region/128/128/0"); LLGridManager::getInstance()->setGridChoice("foo.bar.com"); slurl = LLSLURL("/myregion/1/2/3"); ensure_equals("/: slurl, region + coords - type", slurl.getType(), LLSLURL::LOCATION); ensure_equals("/ slurl, region + coords", slurl.getSLURLString(), "https://foo.bar.com/region/myregion/1/2/3"); slurl = LLSLURL("myregion/1/2/3"); ensure_equals(": slurl, region + coords - type", slurl.getType(), LLSLURL::LOCATION); ensure_equals(" slurl, region + coords", slurl.getSLURLString(), "https://foo.bar.com/region/myregion/1/2/3"); slurl = LLSLURL(LLSLURL::SIM_LOCATION_HOME); ensure_equals("home", slurl.getType(), LLSLURL::HOME_LOCATION); slurl = LLSLURL(LLSLURL::SIM_LOCATION_LAST); ensure_equals("last", slurl.getType(), LLSLURL::LAST_LOCATION); slurl = LLSLURL("secondlife:///app/foo/bar?12345"); ensure_equals("app", slurl.getType(), LLSLURL::APP); ensure_equals("appcmd", slurl.getAppCmd(), "foo"); ensure_equals("apppath", slurl.getAppPath().size(), 1); ensure_equals("apppath2", slurl.getAppPath()[0].asString(), "bar"); ensure_equals("appquery", slurl.getAppQuery(), "12345"); ensure_equals("grid1", "foo.bar.com", slurl.getGrid()); slurl = LLSLURL("secondlife://Aditi/app/foo/bar?12345"); ensure_equals("app", slurl.getType(), LLSLURL::APP); ensure_equals("appcmd", slurl.getAppCmd(), "foo"); ensure_equals("apppath", slurl.getAppPath().size(), 1); ensure_equals("apppath2", slurl.getAppPath()[0].asString(), "bar"); ensure_equals("appquery", slurl.getAppQuery(), "12345"); ensure_equals("grid2", "util.aditi.lindenlab.com", slurl.getGrid()); LLGridManager::getInstance()->setGridChoice("foo.bar.com"); slurl = LLSLURL("secondlife:///secondlife/myregion/1/2/3"); ensure_equals("/: slurl, region + coords - type", slurl.getType(), LLSLURL::LOCATION); ensure_equals("location", slurl.getType(), LLSLURL::LOCATION); ensure_equals("region" , "myregion", slurl.getRegion()); ensure_equals("grid3", "util.agni.lindenlab.com", slurl.getGrid()); slurl = LLSLURL("secondlife://Aditi/secondlife/myregion/1/2/3"); ensure_equals("/: slurl, region + coords - type", slurl.getType(), LLSLURL::LOCATION); ensure_equals("location", slurl.getType(), LLSLURL::LOCATION); ensure_equals("region" , "myregion", slurl.getRegion()); ensure_equals("grid4", "util.aditi.lindenlab.com", slurl.getGrid()); slurl = LLSLURL("https://my.grid.com/app/foo/bar?12345"); ensure_equals("app", slurl.getType(), LLSLURL::APP); ensure_equals("appcmd", slurl.getAppCmd(), "foo"); ensure_equals("apppath", slurl.getAppPath().size(), 1); ensure_equals("apppath2", slurl.getAppPath()[0].asString(), "bar"); ensure_equals("appquery", slurl.getAppQuery(), "12345"); }