summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-03-11 13:49:28 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-03-11 13:53:34 +0200
commit0d1f7cafcd9db3ffff8e22f898005dc34bca5fcb (patch)
tree998938f1ac0476ddadeaef61edc43701211f2981 /indra/newview
parentda27311473c2c2cc35440f88aa25c9378fc8f4d4 (diff)
SL-19109 Fix item updates not getting a callback
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llaisapi.cpp31
1 files changed, 14 insertions, 17 deletions
diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp
index 3826da0341..8e20132ede 100644
--- a/indra/newview/llaisapi.cpp
+++ b/indra/newview/llaisapi.cpp
@@ -483,20 +483,17 @@ void AISAPI::InvokeAISCommandCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t ht
gInventory.onAISUpdateReceived("AISCommand", result);
if (callback && !callback.empty())
- {
+ {
+ bool needs_callback = true;
LLUUID id(LLUUID::null);
- if (type == COPYLIBRARYCATEGORY)
- {
- if (result.has("category_id"))
- {
- id = result["category_id"];
- } //else signal failure
- callback(id);
+ if (type == COPYLIBRARYCATEGORY && result.has("category_id"))
+ {
+ id = result["category_id"];
}
if (type == CREATEINVENTORY)
{
- bool informed_caller = false;
+ // CREATEINVENTORY can have multiple callbacks
if (result.has("_created_categories"))
{
LLSD& cats = result["_created_categories"];
@@ -505,7 +502,7 @@ void AISAPI::InvokeAISCommandCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t ht
{
LLUUID cat_id = *cat_iter;
callback(cat_id);
- informed_caller = true;
+ needs_callback = false;
}
}
if (result.has("_created_items"))
@@ -516,17 +513,17 @@ void AISAPI::InvokeAISCommandCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t ht
{
LLUUID item_id = *item_iter;
callback(item_id);
- informed_caller = true;
+ needs_callback = false;
}
}
-
- if (!informed_caller)
- {
- // signal failure with null id
- callback(id);
- }
}
+ if (needs_callback)
+ {
+ // Call callback at least once regardless of failure.
+ // UPDATEITEM doesn't expect an id
+ callback(id);
+ }
}
}