From a3017978d3b4134c2408eb4e3124d8725a9f4733 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Wed, 11 Nov 2009 00:25:33 +0000 Subject: DEV-41358: Added user's preferred maturity level to search URL. The Search URL now includes a "r=" query parameter to specify the user's preferred maturity rating. This can be "pg" or "pg,mature" or "pg,mature,adult". --- indra/newview/llfloatersearch.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview/llfloatersearch.cpp') diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index 97c573ddea..ca2cdffcf8 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -36,6 +36,7 @@ #include "llmediactrl.h" #include "lllogininstance.h" #include "lluri.h" +#include "llagent.h" LLFloaterSearch::LLFloaterSearch(const LLSD& key) : LLFloater(key), @@ -122,6 +123,12 @@ void LLFloaterSearch::search(const LLSD &key) LLSD search_token = LLLoginInstance::getInstance()->getResponse("search_token"); url += "&p=" + search_token.asString(); + // also append the user's preferred maturity (can be changed via prefs) + std::string maturity = "pg"; + if (gAgent.prefersMature()) maturity += ",mature"; + if (gAgent.prefersAdult()) maturity += ",adult"; + url += "&r=" + maturity; + // and load the URL in the web view mBrowser->navigateTo(url); } -- cgit v1.3 From 6b14f9a48f18842e207013d89e4578a73ee5e7bf Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Wed, 11 Nov 2009 22:42:25 +0000 Subject: DEV-41358: Changed format of preferred maturity for search. Now preferred maturity is passed to the search web pages as an r={13|21|42} query param. --- indra/newview/llfloatersearch.cpp | 16 +++++++++++++--- indra/newview/skins/default/xui/en/floater_search.xml | 4 ++-- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'indra/newview/llfloatersearch.cpp') diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index ca2cdffcf8..e2df2ffdf7 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -124,9 +124,19 @@ void LLFloaterSearch::search(const LLSD &key) url += "&p=" + search_token.asString(); // also append the user's preferred maturity (can be changed via prefs) - std::string maturity = "pg"; - if (gAgent.prefersMature()) maturity += ",mature"; - if (gAgent.prefersAdult()) maturity += ",adult"; + std::string maturity; + if (gAgent.prefersAdult()) + { + maturity = "42"; // PG,Mature,Adult + } + else if (gAgent.prefersMature()) + { + maturity = "21"; // PG,Mature + } + else + { + maturity = "13"; // PG + } url += "&r=" + maturity; // and load the URL in the web view diff --git a/indra/newview/skins/default/xui/en/floater_search.xml b/indra/newview/skins/default/xui/en/floater_search.xml index b9cf456842..d9498586af 100644 --- a/indra/newview/skins/default/xui/en/floater_search.xml +++ b/indra/newview/skins/default/xui/en/floater_search.xml @@ -25,7 +25,7 @@ Done -- cgit v1.3