summaryrefslogtreecommitdiff
path: root/indra/llinventory
diff options
context:
space:
mode:
authorKartic Krishnamurthy <drunkensufi@lindenlab.com>2008-09-16 18:12:32 +0000
committerKartic Krishnamurthy <drunkensufi@lindenlab.com>2008-09-16 18:12:32 +0000
commit80f61963272cc2311c5410671045e34212476134 (patch)
tree2d913b7bc78c60a4e0755b0667d86a32b42fe467 /indra/llinventory
parent96869c0de45c20949ede6deeb4e8f954b7b209ca (diff)
QAR-751 : Merge Agent Inventory Services - Fetch Inventory and Fetch Inventory Descendents - to Release
Related Jiras: 1. DEV-17797 New Top Causes of Inventory Loss is Attachments with null folder_id 2. DEV-17937 null asset id not handled correctly in ais inventory fetch 3. OPSRT-1097 Update python-indra package on the system images 4. DEV-20505 QAR-751: Banning Cap "FetchLibDescendents" results in error in viewer log. 5. DEV-20328 QAR-751 Excessive log spam when using ais viewer against ais sim 6. DEV-20335 QAR-751 AIS bans are missing from message.xml svn merge -r95983:96590 svn+ssh://svn/svn/linden/branches/ais-for-merge-qar-751 . Miscellaneous commit: 1. Fixed silly bug in llsd-rest that broke connects to https on a non-standard port
Diffstat (limited to 'indra/llinventory')
-rw-r--r--indra/llinventory/llinventory.cpp43
-rw-r--r--indra/llinventory/llsaleinfo.cpp11
2 files changed, 49 insertions, 5 deletions
diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp
index 0cdc445069..a126ae4fbf 100644
--- a/indra/llinventory/llinventory.cpp
+++ b/indra/llinventory/llinventory.cpp
@@ -60,6 +60,9 @@ static const std::string INV_SALE_INFO_LABEL("sale_info");
static const std::string INV_FLAGS_LABEL("flags");
static const std::string INV_CREATION_DATE_LABEL("created_at");
+// key used by agent-inventory-service
+static const std::string INV_ASSET_TYPE_LABEL_WS("type_default");
+static const std::string INV_FOLDER_ID_LABEL_WS("category_id");
///----------------------------------------------------------------------------
/// Local function declarations, constants, enums, and typedefs
///----------------------------------------------------------------------------
@@ -949,11 +952,13 @@ LLSD LLInventoryItem::asLLSD() const
sd[INV_SHADOW_ID_LABEL] = shadow_id;
}
sd[INV_ASSET_TYPE_LABEL] = LLAssetType::lookup(mType);
+ sd[INV_INVENTORY_TYPE_LABEL] = mInventoryType;
const char* inv_type_str = LLInventoryType::lookup(mInventoryType);
if(inv_type_str)
{
sd[INV_INVENTORY_TYPE_LABEL] = inv_type_str;
}
+ //sd[INV_FLAGS_LABEL] = (S32)mFlags;
sd[INV_FLAGS_LABEL] = ll_sd_from_U32(mFlags);
sd[INV_SALE_INFO_LABEL] = mSaleInfo;
sd[INV_NAME_LABEL] = mName;
@@ -1026,17 +1031,40 @@ bool LLInventoryItem::fromLLSD(LLSD& sd)
w = INV_ASSET_TYPE_LABEL;
if (sd.has(w))
{
- mType = LLAssetType::lookup(sd[w].asString());
+ if (sd[w].isString())
+ {
+ mType = LLAssetType::lookup(sd[w].asString().c_str());
+ }
+ else if (sd[w].isInteger())
+ {
+ S8 type = (U8)sd[w].asInteger();
+ mType = static_cast<LLAssetType::EType>(type);
+ }
}
w = INV_INVENTORY_TYPE_LABEL;
if (sd.has(w))
{
- mInventoryType = LLInventoryType::lookup(sd[w].asString());
+ if (sd[w].isString())
+ {
+ mInventoryType = LLInventoryType::lookup(sd[w].asString().c_str());
+ }
+ else if (sd[w].isInteger())
+ {
+ S8 type = (U8)sd[w].asInteger();
+ mInventoryType = static_cast<LLInventoryType::EType>(type);
+ }
}
w = INV_FLAGS_LABEL;
if (sd.has(w))
{
- mFlags = ll_U32_from_sd(sd[w]);
+ if (sd[w].isBinary())
+ {
+ mFlags = ll_U32_from_sd(sd[w]);
+ }
+ else if(sd[w].isInteger())
+ {
+ mFlags = sd[w].asInteger();
+ }
}
w = INV_NAME_LABEL;
if (sd.has(w))
@@ -1394,7 +1422,7 @@ bool LLInventoryCategory::fromLLSD(LLSD& sd)
{
std::string w;
- w = INV_ITEM_ID_LABEL;
+ w = INV_FOLDER_ID_LABEL_WS;
if (sd.has(w))
{
mUUID = sd[w];
@@ -1410,6 +1438,13 @@ bool LLInventoryCategory::fromLLSD(LLSD& sd)
S8 type = (U8)sd[w].asInteger();
mPreferredType = static_cast<LLAssetType::EType>(type);
}
+ w = INV_ASSET_TYPE_LABEL_WS;
+ if (sd.has(w))
+ {
+ S8 type = (U8)sd[w].asInteger();
+ mPreferredType = static_cast<LLAssetType::EType>(type);
+ }
+
w = INV_NAME_LABEL;
if (sd.has(w))
{
diff --git a/indra/llinventory/llsaleinfo.cpp b/indra/llinventory/llsaleinfo.cpp
index 111167ae27..9c36f0b7a0 100644
--- a/indra/llinventory/llsaleinfo.cpp
+++ b/indra/llinventory/llsaleinfo.cpp
@@ -114,7 +114,16 @@ bool LLSaleInfo::fromLLSD(LLSD& sd, BOOL& has_perm_mask, U32& perm_mask)
{
const char *w;
- mSaleType = lookup(sd["sale_type"].asString().c_str());
+ if (sd["sale_type"].isString())
+ {
+ mSaleType = lookup(sd["sale_type"].asString().c_str());
+ }
+ else if(sd["sale_type"].isInteger())
+ {
+ S8 type = (U8)sd["sale_type"].asInteger();
+ mSaleType = static_cast<LLSaleInfo::EForSale>(type);
+ }
+
mSalePrice = llclamp(sd["sale_price"].asInteger(), 0, S32_MAX);
w = "perm_mask";
if (sd.has(w))