Scott Lawrence avatar Scott Lawrence committed 364fd63 Merge

merge missing changesets for storm-1557

Comments (0)

Files changed (3)

indra/newview/app_settings/settings.xml

       <key>Type</key>
       <string>String</string>
       <key>Value</key>
-      <string>http://search-beta.secondlife.com/viewer/[CATEGORY]/?q=[QUERY]&amp;p=[AUTH_TOKEN]&amp;r=[MATURITY]&amp;lang=[LANGUAGE]&amp;g=[GODLIKE]&amp;sid=[SESSION_ID]&amp;rid=[REGION_ID]&amp;pid=[PARCEL_ID]&amp;channel=[CHANNEL]&amp;version=[VERSION]&amp;major=[VERSION_MAJOR]&amp;minor=[VERSION_MINOR]&amp;patch=[VERSION_PATCH]&amp;build=[VERSION_BUILD]</string>
+      <string>http://search-beta.secondlife.com/viewer/[CATEGORY]/?q=[QUERY]</string>
     </map>
     <key>WebProfileURL</key>
     <map>

indra/newview/llfloatersearch.cpp

 
 #include "llviewerprecompiledheaders.h"
 
+#include "llappviewer.h"
+#include "llbase64.h"
 #include "llcommandhandler.h"
 #include "llfloaterreg.h"
 #include "llfloatersearch.h"
 #include "llmediactrl.h"
 #include "llnotificationsutil.h"
+#include "llparcel.h"
+#include "llplugincookiestore.h"
 #include "lllogininstance.h"
 #include "lluri.h"
 #include "llagent.h"
+#include "llsdserialize.h"
 #include "llui.h"
 #include "llviewercontrol.h"
+#include "llviewerregion.h"
+#include "llversioninfo.h"
+#include "llviewermedia.h"
+#include "llviewernetwork.h"
+#include "llviewerparcelmgr.h"
 #include "llweb.h"
 
 // support secondlife:///app/search/{CATEGORY}/{QUERY} SLapps
 
 	// add the permissions token that login.cgi gave us
 	// We use "search_token", and fallback to "auth_token" if not present.
+	LLSD search_cookie;
+
 	LLSD search_token = LLLoginInstance::getInstance()->getResponse("search_token");
 	if (search_token.asString().empty())
 	{
 		search_token = LLLoginInstance::getInstance()->getResponse("auth_token");
 	}
-	subs["AUTH_TOKEN"] = search_token.asString();
+	search_cookie["AUTH_TOKEN"] = search_token.asString();
 
 	// add the user's preferred maturity (can be changed via prefs)
 	std::string maturity;
 	{
 		maturity = "13";  // PG
 	}
-	subs["MATURITY"] = maturity;
+	search_cookie["MATURITY"] = maturity;
 
 	// add the user's god status
-	subs["GODLIKE"] = gAgent.isGodlike() ? "1" : "0";
+	search_cookie["GODLIKE"] = gAgent.isGodlike() ? "1" : "0";
+	search_cookie["VERSION"] = LLVersionInfo::getVersion();
+	search_cookie["VERSION_MAJOR"] = LLVersionInfo::getMajor();
+	search_cookie["VERSION_MINOR"] = LLVersionInfo::getMinor();
+	search_cookie["VERSION_PATCH"] = LLVersionInfo::getPatch();
+	search_cookie["VERSION_BUILD"] = LLVersionInfo::getBuild();
+	search_cookie["CHANNEL"] = LLVersionInfo::getChannel();
+	search_cookie["GRID"] = LLGridManager::getInstance()->getGridLabel();
+	search_cookie["OS"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple();
+	search_cookie["SESSION_ID"] = gAgent.getSessionID();
+	search_cookie["FIRST_LOGIN"] = gAgent.isFirstLogin();
+
+	std::string lang = LLUI::getLanguage();
+	if (lang == "en-us")
+	{
+		lang = "en";
+	}
+	search_cookie["LANGUAGE"] = lang;
+
+	// find the region ID
+	LLUUID region_id;
+	LLViewerRegion *region = gAgent.getRegion();
+	if (region)
+	{
+		region_id = region->getRegionID();
+	}
+	search_cookie["REGION_ID"] = region_id;
+
+	// find the parcel local ID
+	S32 parcel_id = 0;
+	LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
+	if (parcel)
+	{
+		parcel_id = parcel->getLocalID();
+	}
+	search_cookie["PARCEL_ID"] = llformat("%d", parcel_id);
+
+	std::stringstream cookie_string_stream;
+	LLSDSerialize::toXML(search_cookie, cookie_string_stream);
+	std::string cookie_string = cookie_string_stream.str();
+
+	U8* cookie_string_buffer = (U8*)cookie_string.c_str();
+	std::string cookie_value = LLBase64::encode(cookie_string_buffer, cookie_string.size());
+
+	// for staging services
+	LLViewerMedia::getCookieStore()->setCookiesFromHost(std::string("viewer_session_info=") + cookie_value, ".lindenlab.com");
+	// for live services
+	LLViewerMedia::getCookieStore()->setCookiesFromHost(std::string("viewer_session_info=") + cookie_value, ".secondlife.com");
 
 	// get the search URL and expand all of the substitutions
 	// (also adds things like [LANGUAGE], [VERSION], [OS], etc.)

indra/newview/llviewermenu.cpp

 		{
 		case 0:
 			gSavedSettings.getControl("SessionSettingsFile")->set(new_session_settings_file);
-			LLAppViewer::instance()->forceQuit();
+			LLAppViewer::instance()->requestQuit();
 			break;
 		case 1:
 		default:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.