summaryrefslogtreecommitdiff
path: root/indra/llinventory/llinventory.cpp
diff options
context:
space:
mode:
authorJosh Bell <josh@lindenlab.com>2008-02-28 18:15:01 +0000
committerJosh Bell <josh@lindenlab.com>2008-02-28 18:15:01 +0000
commit2fdd7c35f33d1d98091547b8e96ad9ebf99dee47 (patch)
tree247ba5247139531ac636bb8b9db7ddf3d5ce6203 /indra/llinventory/llinventory.cpp
parent42bc4ba02abebced9fc3e7f91317ae293cbd20dd (diff)
svn merge -r 80357:80990 svn+ssh://svn.lindenlab.com/svn/linden/branches/Branch_1-19-1-Server --> release
Merge patches from 1.19.1 Server branch: * QAR-293 Fix for hardcoded TTLs in web dataservices * DEV-10826 fix for busted binary and notation parse if handed an unlimited parse size * Bounce apache2 processes before starting backbone/dataserver/simulator * Changing web-ds TTL in a way that any query that has 0 < ttl <=60 will have ttl = 61. * Partial reversion of multiagent-chat to 1.19.0 to address fast memory leak * Fixed minor, non user facing bug in multiagentchat * set-classified-stats: Rewrote to use new MDB2 query reformatting syntax * Fixed possible bad conversion of vivox data * DEV-550, caching changes to DirClassifieds Query * QAR-240 (DEV-8488) Prevent residents from purging stuff that isn't trash on the backend * More mem leak fixes for multiagent-chat * QAR-274 Fetch inventory descendents over TCP (via HTTP cap) instead of UDP * DEV-10151: Sometimes group IMs appear to be person to person IMs * QAR-321 Changes to crash_reporter * DEV-11004 Speed up people search query using FORCE INDEX (PRIMARY) on the username table if the first-name query fragment is >= 3 chars * DEV-11004 Speed up people search query using FORCE INDEX (PRIMARY). Web service version of this, must use two named queries because we need to change the query based on input string length.
Diffstat (limited to 'indra/llinventory/llinventory.cpp')
-rw-r--r--indra/llinventory/llinventory.cpp70
1 files changed, 57 insertions, 13 deletions
diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp
index 4d411e6b8d..272e8ffba2 100644
--- a/indra/llinventory/llinventory.cpp
+++ b/indra/llinventory/llinventory.cpp
@@ -54,6 +54,7 @@ static const std::string INV_INVENTORY_TYPE_LABEL("inv_type");
static const std::string INV_NAME_LABEL("name");
static const std::string INV_DESC_LABEL("desc");
static const std::string INV_PERMISSIONS_LABEL("permissions");
+static const std::string INV_SHADOW_ID_LABEL("shadow_id");
static const std::string INV_ASSET_ID_LABEL("asset_id");
static const std::string INV_SALE_INFO_LABEL("sale_info");
static const std::string INV_FLAGS_LABEL("flags");
@@ -927,34 +928,34 @@ BOOL LLInventoryItem::exportLegacyStream(std::ostream& output_stream, BOOL inclu
LLSD LLInventoryItem::asLLSD() const
{
LLSD sd = LLSD();
- sd["item_id"] = mUUID;
- sd["parent_id"] = mParentUUID;
- sd["permissions"] = ll_create_sd_from_permissions(mPermissions);
+ sd[INV_ITEM_ID_LABEL] = mUUID;
+ sd[INV_PARENT_ID_LABEL] = mParentUUID;
+ sd[INV_PERMISSIONS_LABEL] = ll_create_sd_from_permissions(mPermissions);
U32 mask = mPermissions.getMaskBase();
if(((mask & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED)
|| (mAssetUUID.isNull()))
{
- sd["asset_id"] = mAssetUUID;
+ sd[INV_ASSET_ID_LABEL] = mAssetUUID;
}
else
{
LLUUID shadow_id(mAssetUUID);
LLXORCipher cipher(MAGIC_ID.mData, UUID_BYTES);
cipher.encrypt(shadow_id.mData, UUID_BYTES);
- sd["shadow_id"] = shadow_id;
+ sd[INV_SHADOW_ID_LABEL] = shadow_id;
}
- sd["type"] = LLAssetType::lookup(mType);
+ sd[INV_ASSET_TYPE_LABEL] = LLAssetType::lookup(mType);
const char* inv_type_str = LLInventoryType::lookup(mInventoryType);
if(inv_type_str)
{
- sd["inv_type"] = inv_type_str;
+ sd[INV_INVENTORY_TYPE_LABEL] = inv_type_str;
}
- sd["flags"] = ll_sd_from_U32(mFlags);
- sd["sale_info"] = mSaleInfo;
- sd["name"] = mName;
- sd["desc"] = mDescription;
- sd["creation_date"] = mCreationDate;
+ sd[INV_FLAGS_LABEL] = ll_sd_from_U32(mFlags);
+ sd[INV_SALE_INFO_LABEL] = mSaleInfo;
+ sd[INV_NAME_LABEL] = mName;
+ sd[INV_DESC_LABEL] = mDescription;
+ sd[INV_CREATION_DATE_LABEL] = mCreationDate;
return sd;
}
@@ -1007,7 +1008,7 @@ bool LLInventoryItem::fromLLSD(LLSD& sd)
mPermissions.setMaskNext(perm_mask);
}
}
- w = "shadow_id";
+ w = INV_SHADOW_ID_LABEL;
if (sd.has(w))
{
mAssetUUID = sd[w];
@@ -1357,6 +1358,19 @@ void LLInventoryCategory::setPreferredType(LLAssetType::EType type)
mPreferredType = type;
}
+LLSD LLInventoryCategory::asLLSD() const
+{
+ LLSD sd = LLSD();
+ sd["item_id"] = mUUID;
+ sd["parent_id"] = mParentUUID;
+ S8 type = static_cast<S8>(mPreferredType);
+ sd["type"] = type;
+ sd["name"] = mName;
+
+ return sd;
+}
+
+
// virtual
void LLInventoryCategory::packMessage(LLMessageSystem* msg) const
{
@@ -1367,6 +1381,36 @@ void LLInventoryCategory::packMessage(LLMessageSystem* msg) const
msg->addStringFast(_PREHASH_Name, mName);
}
+bool LLInventoryCategory::fromLLSD(LLSD& sd)
+{
+ std::string w;
+
+ w = INV_ITEM_ID_LABEL;
+ if (sd.has(w))
+ {
+ mUUID = sd[w];
+ }
+ w = INV_PARENT_ID_LABEL;
+ if (sd.has(w))
+ {
+ mParentUUID = sd[w];
+ }
+ w = INV_ASSET_TYPE_LABEL;
+ if (sd.has(w))
+ {
+ S8 type = (U8)sd[w].asInteger();
+ mPreferredType = static_cast<LLAssetType::EType>(type);
+ }
+ w = INV_NAME_LABEL;
+ if (sd.has(w))
+ {
+ mName = sd[w].asString();
+ LLString::replaceNonstandardASCII(mName, ' ');
+ LLString::replaceChar(mName, '|', ' ');
+ }
+ return true;
+}
+
// virtual
void LLInventoryCategory::unpackMessage(LLMessageSystem* msg,
const char* block,