diff options
| author | Yuri Chebotarev <ychebotarev@productengine.com> | 2009-11-26 09:31:55 +0200 |
|---|---|---|
| committer | Yuri Chebotarev <ychebotarev@productengine.com> | 2009-11-26 09:31:55 +0200 |
| commit | 4c81e7a85c3fe69f16ac3996df732627dda8533a (patch) | |
| tree | 25af0dff630ae8d5cbf5e572c8286122ebaf79a7 /indra/newview/llviewerinventory.cpp | |
| parent | 1533f3d2a6fcbfd1550b3840c2d2327283f131c0 (diff) | |
| parent | b19b63ad8cba7b1c3e44c4084313103765af1917 (diff) | |
merge
--HG--
branch : product-engine
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 87d256b60a..c6ec25c1cb 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -56,11 +56,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 ///---------------------------------------------------------------------------- |
