diff options
| author | Tofu Linden <tofu.linden@lindenlab.com> | 2009-11-25 10:49:49 +0000 |
|---|---|---|
| committer | Tofu Linden <tofu.linden@lindenlab.com> | 2009-11-25 10:49:49 +0000 |
| commit | 664b848bac30a7f3f1177a683e0913c9457dc041 (patch) | |
| tree | b284602f6911e31d5ef687e1c06b343ef83627e1 /indra/newview/llviewerinventory.cpp | |
| parent | 6f4099e413d41ba56a5a339122050122363ca952 (diff) | |
| parent | 41eb231e6a41da13549e5cbd4cfe6f5efeab74b1 (diff) | |
merge from trunk.
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 ///---------------------------------------------------------------------------- |
