summaryrefslogtreecommitdiff
path: root/indra/newview/llaisapi.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-03-10 00:12:16 +0200
committerakleshchev <117672381+akleshchev@users.noreply.github.com>2023-03-10 19:32:47 +0200
commitff6ff01c6a3822c8160279fecd3c3f2e636c4349 (patch)
treee67c1726dea96dbe3d06a69eb799265f9a984ea9 /indra/newview/llaisapi.cpp
parent811da7dbb1bdbf04a2dceb02ad4d296db4274076 (diff)
SL-18629 Replacing UDP creation messages with callback based AIS
Diffstat (limited to 'indra/newview/llaisapi.cpp')
-rw-r--r--indra/newview/llaisapi.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp
index d2c59cfaba..3826da0341 100644
--- a/indra/newview/llaisapi.cpp
+++ b/indra/newview/llaisapi.cpp
@@ -93,6 +93,7 @@ void AISAPI::CreateInventory(const LLUUID& parentId, const LLSD& newInventory, c
if (cap.empty())
{
LL_WARNS("Inventory") << "Inventory cap not found!" << LL_ENDL;
+ callback(LLUUID::null);
return;
}
@@ -485,13 +486,17 @@ void AISAPI::InvokeAISCommandCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t ht
{
LLUUID id(LLUUID::null);
- if (result.has("category_id") && (type == COPYLIBRARYCATEGORY))
+ if (type == COPYLIBRARYCATEGORY)
{
- id = result["category_id"];
+ if (result.has("category_id"))
+ {
+ id = result["category_id"];
+ } //else signal failure
callback(id);
}
if (type == CREATEINVENTORY)
{
+ bool informed_caller = false;
if (result.has("_created_categories"))
{
LLSD& cats = result["_created_categories"];
@@ -500,6 +505,7 @@ void AISAPI::InvokeAISCommandCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t ht
{
LLUUID cat_id = *cat_iter;
callback(cat_id);
+ informed_caller = true;
}
}
if (result.has("_created_items"))
@@ -510,8 +516,15 @@ void AISAPI::InvokeAISCommandCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t ht
{
LLUUID item_id = *item_iter;
callback(item_id);
+ informed_caller = true;
}
}
+
+ if (!informed_caller)
+ {
+ // signal failure with null id
+ callback(id);
+ }
}
}