summaryrefslogtreecommitdiff
path: root/indra/newview/llaisapi.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-03-20 22:06:20 +0200
committerakleshchev <117672381+akleshchev@users.noreply.github.com>2023-03-20 23:39:30 +0200
commitb68a67491026a055f0de9df349508b9e60a200ed (patch)
tree546a35d7a8c8be76150be477b128acae6107811f /indra/newview/llaisapi.cpp
parent72131418aa943b93f61508993d7006b02ebd9c35 (diff)
SL-18629 Load cof only once links are ready
Diffstat (limited to 'indra/newview/llaisapi.cpp')
-rw-r--r--indra/newview/llaisapi.cpp68
1 files changed, 36 insertions, 32 deletions
diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp
index ece03d6988..d2bf7a0e9a 100644
--- a/indra/newview/llaisapi.cpp
+++ b/indra/newview/llaisapi.cpp
@@ -637,15 +637,17 @@ void AISAPI::InvokeAISCommandCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t ht
bool needs_callback = true;
LLUUID id(LLUUID::null);
- if ( ( (type == COPYLIBRARYCATEGORY)
- || (type == FETCHCATEGORYCATEGORIES)
- || (type == FETCHCATEGORYCHILDREN))
- && result.has("category_id"))
- {
- id = result["category_id"];
- }
- if (type == FETCHITEM)
+ switch (type)
{
+ case COPYLIBRARYCATEGORY:
+ case FETCHCATEGORYCATEGORIES:
+ case FETCHCATEGORYCHILDREN:
+ if (result.has("category_id"))
+ {
+ id = result["category_id"];
+ }
+ break;
+ case FETCHITEM:
if (result.has("item_id"))
{
id = result["item_id"];
@@ -654,33 +656,35 @@ void AISAPI::InvokeAISCommandCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t ht
{
id = result["linked_id"];
}
- }
- if (type == CREATEINVENTORY)
- {
+ break;
+ case CREATEINVENTORY:
// CREATEINVENTORY can have multiple callbacks
- if (result.has("_created_categories"))
- {
- LLSD& cats = result["_created_categories"];
- LLSD::array_const_iterator cat_iter;
- for (cat_iter = cats.beginArray(); cat_iter != cats.endArray(); ++cat_iter)
- {
- LLUUID cat_id = *cat_iter;
- callback(cat_id);
+ if (result.has("_created_categories"))
+ {
+ LLSD& cats = result["_created_categories"];
+ LLSD::array_const_iterator cat_iter;
+ for (cat_iter = cats.beginArray(); cat_iter != cats.endArray(); ++cat_iter)
+ {
+ LLUUID cat_id = *cat_iter;
+ callback(cat_id);
needs_callback = false;
- }
- }
- if (result.has("_created_items"))
- {
- LLSD& items = result["_created_items"];
- LLSD::array_const_iterator item_iter;
- for (item_iter = items.beginArray(); item_iter != items.endArray(); ++item_iter)
- {
- LLUUID item_id = *item_iter;
- callback(item_id);
+ }
+ }
+ if (result.has("_created_items"))
+ {
+ LLSD& items = result["_created_items"];
+ LLSD::array_const_iterator item_iter;
+ for (item_iter = items.beginArray(); item_iter != items.endArray(); ++item_iter)
+ {
+ LLUUID item_id = *item_iter;
+ callback(item_id);
needs_callback = false;
- }
- }
- }
+ }
+ }
+ break;
+ default:
+ break;
+ }
if (needs_callback)
{