summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llagentwearables.cpp18
-rw-r--r--indra/newview/llinventorymodel.cpp7
2 files changed, 17 insertions, 8 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index 79948abefd..e75d94bb2c 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -871,6 +871,13 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs
if (mInitialWearablesUpdateReceived)
return;
mInitialWearablesUpdateReceived = true;
+
+ // If this is the very first time the user has logged into viewer2+ from a legacy viewer,
+ // then auto-populate outfits from the library into the My Outfits folder.
+ if (LLInventoryModel::getIsFirstTimeInViewer2())
+ {
+ gAgentWearables.populateMyOutfitsFolder();
+ }
LLUUID agent_id;
gMessageSystem->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id);
@@ -880,12 +887,15 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs
{
gMessageSystem->getU32Fast(_PREHASH_AgentData, _PREHASH_SerialNum, gAgentQueryManager.mUpdateSerialNum);
+ const S32 NUM_BODY_PARTS = 4;
S32 num_wearables = gMessageSystem->getNumberOfBlocksFast(_PREHASH_WearableData);
- if (num_wearables < 4)
+ if (num_wearables < NUM_BODY_PARTS)
{
// Transitional state. Avatars should always have at least their body parts (hair, eyes, shape and skin).
- // The fact that they don't have any here (only a dummy is sent) implies that this account existed
- // before we had wearables, or that the database has gotten messed up.
+ // The fact that they don't have any here (only a dummy is sent) implies that either:
+ // 1. This account existed before we had wearables
+ // 2. The database has gotten messed up
+ // 3. This is the account's first login (i.e. the wearables haven't been generated yet).
return;
}
@@ -954,8 +964,6 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs
gInventory.addObserver(outfit);
}
- if (LLInventoryModel::getIsFirstTimeInViewer2())
- gAgentWearables.populateMyOutfitsFolder();
}
}
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 26a81ab084..96925490cf 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -2518,6 +2518,10 @@ void LLInventoryModel::buildParentChildMap()
llwarns << "Found " << lost << " lost categories." << llendl;
}
+ const BOOL COF_exists = (findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, FALSE) != LLUUID::null);
+ sFirstTimeInViewer2 = !COF_exists || gAgent.isFirstLogin();
+
+
// Now the items. We allocated in the last step, so now all we
// have to do is iterate over the items and put them in the right
// place.
@@ -2615,9 +2619,6 @@ void LLInventoryModel::buildParentChildMap()
notifyObservers();
}
}
-
- const BOOL COF_exists = (findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, FALSE) != LLUUID::null);
- sFirstTimeInViewer2 = !COF_exists;
}
struct LLUUIDAndName