diff options
author | Martin Reddy <lynx@lindenlab.com> | 2009-11-02 11:37:44 +0000 |
---|---|---|
committer | Martin Reddy <lynx@lindenlab.com> | 2009-11-02 11:37:44 +0000 |
commit | 99aa77baae97b8de22339bded6ba890bcb86b3ee (patch) | |
tree | 30bae58f4aad88eb6aca0e1748d67c9991dbd56d /indra/newview/llfloatersearch.cpp | |
parent | 99d9712dd7f2a11a1094cba380f92e677710b56b (diff) |
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).
Diffstat (limited to 'indra/newview/llfloatersearch.cpp')
-rw-r--r-- | indra/newview/llfloatersearch.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index 4c83530f43..bd9798c18e 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -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); } |