summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorymodel.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2023-01-24 20:15:22 +0000
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2023-01-24 20:15:22 +0000
commitce5ac93883b71b6abf8cffa35204541e257c6b02 (patch)
tree0c636e149c36fa12c1ee6ed8d140c513a1b6cfaf /indra/newview/llinventorymodel.cpp
parent819eec6f8c3abbf71ec3bdaaf4891068574fdc46 (diff)
SL-18629 - various notes on work for D567
Diffstat (limited to 'indra/newview/llinventorymodel.cpp')
-rw-r--r--indra/newview/llinventorymodel.cpp37
1 files changed, 36 insertions, 1 deletions
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index a7b3076e52..b64dd431db 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -700,8 +700,13 @@ LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id,
name.assign(LLViewerFolderType::lookupNewCategoryName(preferred_type));
}
+#ifdef USE_AIS_FOR_NC
+ // D567 currently this doesn't really work due to limitations in
+ // AIS3, also violates the common caller assumption that we can
+ // assign the id and return immediately.
if (callback)
{
+ // D567 note that we no longer assign the UUID in the viewer, so various workflows need to change.
LLSD new_inventory = LLSD::emptyMap();
new_inventory["categories"] = LLSD::emptyArray();
LLViewerInventoryCategory cat(LLUUID::null, parent_id, preferred_type, name, gAgent.getID());
@@ -711,17 +716,47 @@ LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id,
return LLUUID::null;
}
+#else
+ LLViewerRegion* viewer_region = gAgent.getRegion();
+ std::string url;
+ if ( viewer_region )
+ url = viewer_region->getCapability("CreateInventoryCategory");
+
+ if (!url.empty() && callback)
+ {
+ //Let's use the new capability.
+
+ id.generate();
+ LLSD request, body;
+ body["folder_id"] = id;
+ body["parent_id"] = parent_id;
+ body["type"] = (LLSD::Integer) preferred_type;
+ body["name"] = name;
+
+ request["message"] = "CreateInventoryCategory";
+ request["payload"] = body;
+
+ LL_DEBUGS(LOG_INV) << "Creating category via request: " << ll_pretty_print_sd(request) << LL_ENDL;
+ LLCoros::instance().launch("LLInventoryModel::createNewCategoryCoro",
+ boost::bind(&LLInventoryModel::createNewCategoryCoro, this, url, body, callback));
+
+ return LLUUID::null;
+ }
+#endif
+
if (!gMessageSystem)
{
return LLUUID::null;
}
- // FIXME this UDP code path needs to be removed. Requires
+ // D567 FIXME this UDP code path needs to be removed. Requires
// reworking many of the callers to use callbacks rather than
// assuming instant success.
// Add the category to the internal representation
+ LL_WARNS() << "D567 need to remove this usage" << LL_ENDL;
+
id.generate();
LLPointer<LLViewerInventoryCategory> cat =
new LLViewerInventoryCategory(id, parent_id, preferred_type, name, gAgent.getID());