summaryrefslogtreecommitdiff
path: root/indra/newview/llappearancemgr.cpp
diff options
context:
space:
mode:
authorsimon <simon@lindenlab.com>2024-01-03 01:34:58 +0000
committersimon <simon@lindenlab.com>2024-01-03 01:34:58 +0000
commit520f710cd6b5826403383f8c3488a94c64ac8081 (patch)
tree3936a248d991e11b82768ff10a5079789299bb53 /indra/newview/llappearancemgr.cpp
parentd4c3300f9b81296f765c83c1e822251e86d91925 (diff)
parenta592292242e29d0379ee72572a434359e1e892d1 (diff)
Merge remote-tracking branch 'origin/main' into simon/sl-20635-new-data
Diffstat (limited to 'indra/newview/llappearancemgr.cpp')
-rw-r--r--indra/newview/llappearancemgr.cpp72
1 files changed, 31 insertions, 41 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 8010b84c20..4c3a9229d2 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -2776,9 +2776,23 @@ void LLAppearanceMgr::wearInventoryCategory(LLInventoryCategory* category, bool
else
{
selfStartPhase("wear_inventory_category_fetch");
- callAfterCategoryFetch(category->getUUID(),boost::bind(&LLAppearanceMgr::wearCategoryFinal,
- &LLAppearanceMgr::instance(),
- category->getUUID(), copy, append));
+ if (AISAPI::isAvailable() && category->getPreferredType() == LLFolderType::FT_OUTFIT)
+ {
+ // for reliability just fetch it whole, linked items included
+ LLUUID cat_id = category->getUUID();
+ LLInventoryModelBackgroundFetch::getInstance()->fetchFolderAndLinks(
+ cat_id,
+ [cat_id, copy, append]
+ {
+ LLAppearanceMgr::instance().wearCategoryFinal(cat_id, copy, append);
+ });
+ }
+ else
+ {
+ callAfterCategoryFetch(category->getUUID(), boost::bind(&LLAppearanceMgr::wearCategoryFinal,
+ &LLAppearanceMgr::instance(),
+ category->getUUID(), copy, append));
+ }
}
}
@@ -2787,7 +2801,7 @@ S32 LLAppearanceMgr::getActiveCopyOperations() const
return LLCallAfterInventoryCopyMgr::getInstanceCount();
}
-void LLAppearanceMgr::wearCategoryFinal(LLUUID& cat_id, bool copy_items, bool append)
+void LLAppearanceMgr::wearCategoryFinal(const LLUUID& cat_id, bool copy_items, bool append)
{
LL_INFOS("Avatar") << self_av_string() << "starting" << LL_ENDL;
@@ -4571,30 +4585,20 @@ protected:
void callAfterCOFFetch(nullary_func_t cb)
{
- LLUUID cat_id = LLAppearanceMgr::instance().getCOF();
- LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id);
-
if (AISAPI::isAvailable())
{
- // Mark cof (update timer) so that background fetch won't request it
- cat->setFetching(LLViewerInventoryCategory::FETCH_RECURSIVE);
// For reliability assume that we have no relevant cache, so
// fetch cof along with items cof's links point to.
- AISAPI::FetchCOF([cb](const LLUUID& id)
- {
- cb();
- LLUUID cat_id = LLAppearanceMgr::instance().getCOF();
- LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id);
- if (cat)
- {
- cat->setFetching(LLViewerInventoryCategory::FETCH_NONE);
- }
- });
+ LLInventoryModelBackgroundFetch::getInstance()->fetchCOF(cb);
}
else
{
LL_INFOS() << "AIS API v3 not available, using callAfterCategoryFetch" << LL_ENDL;
- // startup should have marked folder as fetching, remove that
+ LLUUID cat_id = LLAppearanceMgr::instance().getCOF();
+ LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id);
+
+ // Special case, startup should have marked cof as FETCH_RECURSIVE
+ // to prevent dupplicate request, remove that
cat->setFetching(LLViewerInventoryCategory::FETCH_NONE);
callAfterCategoryFetch(cat_id, cb);
}
@@ -4616,30 +4620,16 @@ void callAfterCategoryFetch(const LLUUID& cat_id, nullary_func_t cb)
void callAfterCategoryLinksFetch(const LLUUID &cat_id, nullary_func_t cb)
{
- LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id);
if (AISAPI::isAvailable())
{
- // Mark folder (update timer) so that background fetch won't request it
- cat->setFetching(LLViewerInventoryCategory::FETCH_RECURSIVE);
// Assume that we have no relevant cache. Fetch folder, and items folder's links point to.
- AISAPI::FetchCategoryLinks(cat_id,
- [cb, cat_id](const LLUUID &id)
- {
- cb();
- LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id);
- if (cat)
- {
- cat->setFetching(LLViewerInventoryCategory::FETCH_NONE);
- }
- });
- }
- else
- {
- LL_WARNS() << "AIS API v3 not available, can't use AISAPI::FetchCOF" << LL_ENDL;
- // startup should have marked folder as fetching, remove that
- cat->setFetching(LLViewerInventoryCategory::FETCH_NONE);
- callAfterCategoryFetch(cat_id, cb);
- }
+ LLInventoryModelBackgroundFetch::getInstance()->fetchFolderAndLinks(cat_id, cb);
+ }
+ else
+ {
+ LL_WARNS() << "AIS API v3 not available, can't use AISAPI::FetchCOF" << LL_ENDL;
+ callAfterCategoryFetch(cat_id, cb);
+ }
}