summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerinventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerinventory.cpp')
-rwxr-xr-xindra/newview/llviewerinventory.cpp78
1 files changed, 60 insertions, 18 deletions
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index 24096e3222..729af3c8ed 100755
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -79,6 +79,15 @@ static const char * const LOG_INV("Inventory");
static const char * const LOG_LOCAL("InventoryLocalize");
static const char * const LOG_NOTECARD("copy_inventory_from_notecard");
+#if 1
+// temp code in transition
+void doInventoryCb(LLPointer<LLInventoryCallback> cb, LLUUID id)
+{
+ if (cb.notNull())
+ cb->fire(id);
+}
+#endif
+
///----------------------------------------------------------------------------
/// Helper class to store special inventory item names and their localized values.
///----------------------------------------------------------------------------
@@ -1285,8 +1294,13 @@ void link_inventory_array(const LLUUID& category,
{
LLSD new_inventory = LLSD::emptyMap();
new_inventory["links"] = links;
- LLPointer<AISCommand> cmd_ptr = new CreateInventoryCommand(category, new_inventory, cb);
- ais_ran = cmd_ptr->run_command();
+#if 1
+ AISAPI::completion_t cr = boost::bind(&doInventoryCb, cb, _1);
+ AISAPI::CreateInventoryCommand(category, new_inventory, cr);
+#else
+ LLPointer<AISCommand> cmd_ptr = new CreateInventoryCommand(category, new_inventory, cb);
+ ais_ran = cmd_ptr->run_command();
+#endif
}
if (!ais_ran)
@@ -1361,8 +1375,13 @@ void update_inventory_item(
updates.erase("shadow_id");
updates["hash_id"] = update_item->getTransactionID();
}
+#if 1
+ AISAPI::completion_t cr = boost::bind(&doInventoryCb, cb, _1);
+ AISAPI::UpdateItemCommand(item_id, updates, cr);
+#else
LLPointer<AISCommand> cmd_ptr = new UpdateItemCommand(item_id, updates, cb);
ais_ran = cmd_ptr->run_command();
+#endif
}
if (!ais_ran)
{
@@ -1403,8 +1422,13 @@ void update_inventory_item(
bool ais_ran = false;
if (AISCommand::isAPIAvailable())
{
+#if 1
+ AISAPI::completion_t cr = boost::bind(&doInventoryCb, cb, _1);
+ AISAPI::UpdateItemCommand(item_id, updates, cr);
+#else
LLPointer<AISCommand> cmd_ptr = new UpdateItemCommand(item_id, updates, cb);
ais_ran = cmd_ptr->run_command();
+#endif
}
if (!ais_ran)
{
@@ -1459,8 +1483,13 @@ void update_inventory_category(
if (AISCommand::isAPIAvailable())
{
LLSD new_llsd = new_cat->asLLSD();
+#if 1
+ AISAPI::completion_t cr = boost::bind(&doInventoryCb, cb, _1);
+ AISAPI::UpdateCategoryCommand(cat_id, new_llsd, cr);
+#else
LLPointer<AISCommand> cmd_ptr = new UpdateCategoryCommand(cat_id, new_llsd, cb);
cmd_ptr->run_command();
+#endif
}
else // no cap
{
@@ -1524,8 +1553,13 @@ void remove_inventory_item(
LL_DEBUGS(LOG_INV) << "item_id: [" << item_id << "] name " << obj->getName() << LL_ENDL;
if (AISCommand::isAPIAvailable())
{
+#if 1
+ AISAPI::completion_t cr = boost::bind(&doInventoryCb, cb, _1);
+ AISAPI::RemoveItemCommand(item_id, cr);
+#else
LLPointer<AISCommand> cmd_ptr = new RemoveItemCommand(item_id, cb);
cmd_ptr->run_command();
+#endif
if (immediate_delete)
{
@@ -1600,8 +1634,13 @@ void remove_inventory_category(
}
if (AISCommand::isAPIAvailable())
{
+#if 1
+ AISAPI::completion_t cr = boost::bind(&doInventoryCb, cb, _1);
+ AISAPI::RemoveCategoryCommand(cat_id, cr);
+#else
LLPointer<AISCommand> cmd_ptr = new RemoveCategoryCommand(cat_id, cb);
cmd_ptr->run_command();
+#endif
}
else // no cap
{
@@ -1703,8 +1742,13 @@ void purge_descendents_of(const LLUUID& id, LLPointer<LLInventoryCallback> cb)
{
if (AISCommand::isAPIAvailable())
{
- LLPointer<AISCommand> cmd_ptr = new PurgeDescendentsCommand(id, cb);
+#if 1
+ AISAPI::completion_t cr = boost::bind(&doInventoryCb, cb, _1);
+ AISAPI::PurgeDescendentsCommand(id, cr);
+#else
+ LLPointer<AISCommand> cmd_ptr = new PurgeDescendentsCommand(id, cb);
cmd_ptr->run_command();
+#endif
}
else // no cap
{
@@ -1780,27 +1824,20 @@ void copy_inventory_from_notecard(const LLUUID& destination_id,
return;
}
- // check capability to prevent a crash while LL_ERRS in LLCapabilityListener::capListener. See EXT-8459.
- std::string url = viewer_region->getCapability("CopyInventoryFromNotecard");
- if (url.empty())
- {
- LL_WARNS(LOG_NOTECARD) << "There is no 'CopyInventoryFromNotecard' capability"
- << " for region: " << viewer_region->getName()
- << LL_ENDL;
- return;
- }
-
- LLSD request, body;
+ LLSD body;
body["notecard-id"] = notecard_inv_id;
body["object-id"] = object_id;
body["item-id"] = src->getUUID();
body["folder-id"] = destination_id;
body["callback-id"] = (LLSD::Integer)callback_id;
- request["message"] = "CopyInventoryFromNotecard";
- request["payload"] = body;
-
- viewer_region->getCapAPI().post(request);
+ /// *TODO: RIDER: This posts the request under the agents policy.
+ /// When I convert the inventory over this call should be moved under that
+ /// policy as well.
+ if (!gAgent.requestPostCapability("CopyInventoryFromNotecard", body))
+ {
+ LL_WARNS() << "SIM does not have the capability to copy from notecard." << LL_ENDL;
+ }
}
void create_new_item(const std::string& name,
@@ -1862,8 +1899,13 @@ void slam_inventory_folder(const LLUUID& folder_id,
{
LL_DEBUGS(LOG_INV) << "using AISv3 to slam folder, id " << folder_id
<< " new contents: " << ll_pretty_print_sd(contents) << LL_ENDL;
+#if 1
+ AISAPI::completion_t cr = boost::bind(&doInventoryCb, cb, _1);
+ AISAPI::SlamFolderCommand(folder_id, contents, cr);
+#else
LLPointer<AISCommand> cmd_ptr = new SlamFolderCommand(folder_id, contents, cb);
cmd_ptr->run_command();
+#endif
}
else // no cap
{