summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryobserver.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-03-24 00:34:48 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-03-24 00:34:48 +0200
commit1800e969c5fa443f18ea4b01e59840e4bbf2afeb (patch)
treef1d93dfe9814a40ad0ba9b1de9cdc14fd6bcfd5c /indra/newview/llinventoryobserver.cpp
parent6826ed7167e15f05e721e6aa9ade3c655991ccee (diff)
SL-18003 Use AISv3 cap in LLInventoryFetchItemsObserver
Diffstat (limited to 'indra/newview/llinventoryobserver.cpp')
-rw-r--r--indra/newview/llinventoryobserver.cpp37
1 files changed, 31 insertions, 6 deletions
diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp
index b884721895..809fbe4100 100644
--- a/indra/newview/llinventoryobserver.cpp
+++ b/indra/newview/llinventoryobserver.cpp
@@ -37,6 +37,7 @@
#include "llagent.h"
#include "llagentwearables.h"
+#include "llaisapi.h"
#include "llfloater.h"
#include "llfocusmgr.h"
#include "llinventorybridge.h"
@@ -251,6 +252,8 @@ void fetch_items_from_llsd(const LLSD& items_llsd)
void LLInventoryFetchItemsObserver::startFetch()
{
+ bool aisv3 = AISAPI::isAvailable();
+
LLUUID owner_id;
LLSD items_llsd;
for (uuid_vec_t::const_iterator it = mIDs.begin(); it < mIDs.end(); ++it)
@@ -294,17 +297,39 @@ void LLInventoryFetchItemsObserver::startFetch()
// pack this on the message.
mIncomplete.push_back(*it);
- // Prepare the data to fetch
- LLSD item_entry;
- item_entry["owner_id"] = owner_id;
- item_entry["item_id"] = (*it);
- items_llsd.append(item_entry);
+ if (aisv3)
+ {
+ // doesn't support bulk fetching, request one by one
+ if (owner_id == ALEXANDRIA_LINDEN_ID)
+ {
+ AISAPI::FetchItem(*it, AISAPI::LIBRARY);
+ }
+ else
+ {
+ AISAPI::FetchItem(*it, AISAPI::INVENTORY);
+ }
+ // Todo: remove item from mIncomplete on callback
+ // but keep in mind that observer can expire before
+ // callback
+ }
+ else
+ {
+ // Prepare the data to fetch
+ LLSD item_entry;
+ item_entry["owner_id"] = owner_id;
+ item_entry["item_id"] = (*it);
+ items_llsd.append(item_entry);
+ }
}
mFetchingPeriod.reset();
mFetchingPeriod.setTimerExpirySec(FETCH_TIMER_EXPIRY);
- fetch_items_from_llsd(items_llsd);
+ if (!aisv3)
+ {
+ fetch_items_from_llsd(items_llsd);
+ }
+
}
LLInventoryFetchDescendentsObserver::LLInventoryFetchDescendentsObserver(const LLUUID& cat_id) :