diff options
| author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2025-09-23 20:20:05 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-23 20:20:05 +0300 |
| commit | 6dba35d74e27125b39860f9a3df176d7f3a087b5 (patch) | |
| tree | fe7bd6f713b39eacfc9d38e5a7a438bda543333b /indra | |
| parent | 1d9f87df4f1d7483c8dd68640c4138d794f71fc5 (diff) | |
#4719 use correct search query when navigating to the page
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llfloatersearch.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index 9762154a26..8e6a47dce5 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -44,8 +44,22 @@ class LLSearchHandler : public LLCommandHandler { bool handle(const LLSD& tokens, const LLSD& query_map, const std::string& grid, LLMediaCtrl* web) { const size_t parts = tokens.size(); + // get the (optional) category for the search + std::string collection; + if (parts > 0) + { + collection = tokens[0].asString(); + } + + // get the (optional) search string + std::string search_text; + if (parts > 1) + { + search_text = tokens[1].asString(); + } + // open the search floater and perform the requested search - LLFloaterReg::showInstance("search", tokens); + LLFloaterReg::showInstance("search", llsd::map("collection", collection,"query", search_text)); return true; } }; @@ -84,25 +98,11 @@ void LLFloaterSearch::initiateSearch(const LLSD& tokens) // substituted into the final URL using the logic from the original search. subs["TYPE"] = "standard"; - const size_t parts = tokens.size(); + std::string collection = tokens.has("collection") ? tokens["collection"].asString() : ""; - // get the (optional) category for the search - std::string collection; - if (parts > 0) - { - collection = tokens[0].asString(); - } - - // get the (optional) search string - std::string search_text; - if (parts > 1) - { - search_text = tokens[1].asString(); - } + std::string search_text = tokens.has("query") ? tokens["query"].asString() : ""; - // TODO: where does category get set? I cannot find a reference to - // it in internal docs - might be conflated with values in mSearchType - std::string category; + std::string category = tokens.has("category") ? tokens["category"].asString() : ""; if (mSearchType.find(category) != mSearchType.end()) { subs["TYPE"] = category; |
