DEV-41358: Include the current user's maturity and teen ratings in the
URL that we send to the Search web page. This can be used to determine the maturity levels to display. These bools are passed as query params in the URL (as agreed upon with the search team).meow-7.2.2
parent
99d9712dd7
commit
99aa77baae
|
|
@ -34,6 +34,7 @@
|
|||
#include "llviewerprecompiledheaders.h"
|
||||
#include "llfloatersearch.h"
|
||||
#include "llmediactrl.h"
|
||||
#include "llagent.h"
|
||||
|
||||
|
||||
LLFloaterSearch::LLFloaterSearch(const LLSD& key) :
|
||||
|
|
@ -117,6 +118,14 @@ void LLFloaterSearch::search(const LLSD &key)
|
|||
std::string search_text = key.has("id") ? key["id"].asString() : "";
|
||||
url += std::string("?q=") + search_text;
|
||||
|
||||
// append the maturity and teen capabilities for this agent
|
||||
BOOL godlike = gAgent.isGodlike();
|
||||
bool mature_enabled = gAgent.canAccessMature() || godlike;
|
||||
bool adult_enabled = gAgent.canAccessAdult() || godlike;
|
||||
std::string mature = (mature_enabled) ? "True" : "False";
|
||||
std::string teen = (!adult_enabled) ? "True" : "False";
|
||||
url += "&t=" + teen + "&m=" + mature;
|
||||
|
||||
// and load the URL in the web view
|
||||
mBrowser->navigateTo(url);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue