diff options
author | James Cook <james@lindenlab.com> | 2009-11-25 12:31:24 -0800 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2009-11-25 12:31:24 -0800 |
commit | 957055396d2ffa3a76b09c60cb9c3e1f73870cbf (patch) | |
tree | 632ecbdc0c21b0e14eb72f74faa8c04765f54489 /indra/newview/llviewerinventory.cpp | |
parent | ef46d4077ca4aad322aabfe545885be136577c8a (diff) | |
parent | 59eb8a43a467ecaa5a8c2b58bf1abfb8350c0202 (diff) |
merge in changes from viewer-2-0, manually fixed conflict in llviewermessages.cpp
Diffstat (limited to 'indra/newview/llviewerinventory.cpp')
-rw-r--r-- | indra/newview/llviewerinventory.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index d99d2f0870..d0ae5d1e38 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -57,11 +57,43 @@ #include "lltrans.h" #include "llappearancemgr.h" #include "llfloatercustomize.h" +#include "llcommandhandler.h" +#include "llviewermessage.h" ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs ///---------------------------------------------------------------------------- +class LLInventoryHandler : public LLCommandHandler +{ +public: + // requires trusted browser to trigger + LLInventoryHandler() : LLCommandHandler("inventory", UNTRUSTED_THROTTLE) { } + + bool handle(const LLSD& params, const LLSD& query_map, + LLMediaCtrl* web) + { + if (params.size() < 2) return false; + LLUUID inventory_id; + if (!inventory_id.set(params[0], FALSE)) + { + return false; + } + + const std::string verb = params[1].asString(); + if (verb == "select") + { + std::vector<LLUUID> items_to_open; + items_to_open.push_back(inventory_id); + open_inventory_offer(items_to_open, ""); + return true; + } + + return false; + } +}; +LLInventoryHandler gInventoryHandler; + ///---------------------------------------------------------------------------- /// Class LLViewerInventoryItem ///---------------------------------------------------------------------------- |