From ff6ff01c6a3822c8160279fecd3c3f2e636c4349 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 10 Mar 2023 00:12:16 +0200 Subject: SL-18629 Replacing UDP creation messages with callback based AIS --- indra/newview/llaisapi.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'indra/newview/llaisapi.cpp') 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); + } } } -- cgit v1.2.3