diff options
author | Brad Linden <brad@lindenlab.com> | 2023-12-14 12:07:18 -0800 |
---|---|---|
committer | Brad Linden <brad@lindenlab.com> | 2023-12-14 12:07:18 -0800 |
commit | 4c791e098d3abafa406e0e269038c40aae67f66c (patch) | |
tree | d566be04939faf3dc29655a8113afc067b2b7c99 /indra/newview/llviewerinventory.cpp | |
parent | c74dbc6e5b117bcd020c0efecf5255ad731f310f (diff) | |
parent | a592292242e29d0379ee72572a434359e1e892d1 (diff) |
Merge remote-tracking branch 'origin/main' into DRTVWR-596
Diffstat (limited to 'indra/newview/llviewerinventory.cpp')
-rw-r--r-- | indra/newview/llviewerinventory.cpp | 51 |
1 files changed, 43 insertions, 8 deletions
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 1b70e5f84f..0a0a19d095 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -232,9 +232,29 @@ LLLocalizedInventoryItemsDictionary::LLLocalizedInventoryItemsDictionary() class LLInventoryHandler : public LLCommandHandler { public: - // requires trusted browser to trigger - LLInventoryHandler() : LLCommandHandler("inventory", UNTRUSTED_CLICK_ONLY) { } - + LLInventoryHandler() : LLCommandHandler("inventory", UNTRUSTED_THROTTLE) { } + + virtual bool canHandleUntrusted( + const LLSD& params, + const LLSD& query_map, + LLMediaCtrl* web, + const std::string& nav_type) + { + if (params.size() < 1) + { + return true; // don't block, will fail later + } + + if (nav_type == NAV_TYPE_CLICKED + || nav_type == NAV_TYPE_EXTERNAL) + { + // NAV_TYPE_EXTERNAL will be throttled + return true; + } + + return false; + } + bool handle(const LLSD& params, const LLSD& query_map, const std::string& grid, @@ -1151,14 +1171,29 @@ void create_inventory_item( gAgent.sendReliableMessage(); } +void create_inventory_callingcard_callback(LLPointer<LLInventoryCallback> cb, + const LLUUID &parent, + const LLUUID &avatar_id, + const LLAvatarName &av_name) +{ + std::string item_desc = avatar_id.asString(); + create_inventory_item(gAgent.getID(), + gAgent.getSessionID(), + parent, + LLTransactionID::tnull, + av_name.getUserName(), + item_desc, + LLAssetType::AT_CALLINGCARD, + LLInventoryType::IT_CALLINGCARD, + NO_INV_SUBTYPE, + PERM_MOVE | PERM_TRANSFER, + cb); +} + void create_inventory_callingcard(const LLUUID& avatar_id, const LLUUID& parent /*= LLUUID::null*/, LLPointer<LLInventoryCallback> cb/*=NULL*/) { - std::string item_desc = avatar_id.asString(); LLAvatarName av_name; - LLAvatarNameCache::get(avatar_id, &av_name); - create_inventory_item(gAgent.getID(), gAgent.getSessionID(), - parent, LLTransactionID::tnull, av_name.getUserName(), item_desc, LLAssetType::AT_CALLINGCARD, - LLInventoryType::IT_CALLINGCARD, NO_INV_SUBTYPE, PERM_MOVE | PERM_TRANSFER, cb); + LLAvatarNameCache::get(avatar_id, boost::bind(&create_inventory_callingcard_callback, cb, parent, _1, _2)); } void create_inventory_wearable(const LLUUID& agent_id, const LLUUID& session_id, |