diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-03-10 20:15:41 +0200 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-03-10 20:19:14 +0200 |
commit | 80b33a015735daf08b8904b3581b3edcce9368d3 (patch) | |
tree | 78d1c9bf01401929a22af8f30af6ade23e1b98c4 /indra/llinventory/llinventory.cpp | |
parent | ff6ff01c6a3822c8160279fecd3c3f2e636c4349 (diff) |
SL-18629 Unpack thumbnail asset id
Diffstat (limited to 'indra/llinventory/llinventory.cpp')
-rw-r--r-- | indra/llinventory/llinventory.cpp | 56 |
1 files changed, 54 insertions, 2 deletions
diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp index abe1b4dbd3..db18bd4c0e 100644 --- a/indra/llinventory/llinventory.cpp +++ b/indra/llinventory/llinventory.cpp @@ -44,6 +44,7 @@ static const std::string INV_ITEM_ID_LABEL("item_id"); static const std::string INV_FOLDER_ID_LABEL("cat_id"); static const std::string INV_PARENT_ID_LABEL("parent_id"); +static const std::string INV_THUMBNAIL_LABEL("thumbnail"); static const std::string INV_THUMBNAIL_ID_LABEL("thumbnail_id"); static const std::string INV_ASSET_TYPE_LABEL("type"); static const std::string INV_PREFERRED_TYPE_LABEL("preferred_type"); @@ -863,6 +864,34 @@ bool LLInventoryItem::fromLLSD(const LLSD& sd, bool is_new) { mParentUUID = sd[w]; } + w = INV_THUMBNAIL_LABEL; + if (sd.has(w)) + { + LLSD thumbnail_map = sd[w]; + w = INV_ASSET_ID_LABEL; + if (thumbnail_map.has(w)) + { + mThumbnailUUID = thumbnail_map[w]; + } + /* + <key> asset_id </key> + <uuid> acc0ec86 - 17f2 - 4b92 - ab41 - 6718b1f755f7 </uuid> + <key> perms </key> + <integer> 8 </integer> + <key>service</key> + <integer> 3 </integer> + <key>version</key> + <integer> 1 </key> + */ + } + else + { + w = INV_THUMBNAIL_ID_LABEL; + if (sd.has(w)) + { + mThumbnailUUID = sd[w]; + } + } w = INV_PERMISSIONS_LABEL; if (sd.has(w)) { @@ -1071,10 +1100,33 @@ bool LLInventoryCategory::fromLLSD(const LLSD& sd) { mParentUUID = sd[w]; } - w = INV_THUMBNAIL_ID_LABEL; + w = INV_THUMBNAIL_LABEL; if (sd.has(w)) { - mThumbnailUUID = sd[w]; + LLSD thumbnail_map = sd[w]; + w = INV_ASSET_ID_LABEL; + if (thumbnail_map.has(w)) + { + mThumbnailUUID = thumbnail_map[w]; + } + /* + <key> asset_id </key> + <uuid> acc0ec86 - 17f2 - 4b92 - ab41 - 6718b1f755f7 </uuid> + <key> perms </key> + <integer> 8 </integer> + <key>service</key> + <integer> 3 </integer> + <key>version</key> + <integer> 1 </key> + */ + } + else + { + w = INV_THUMBNAIL_ID_LABEL; + if (sd.has(w)) + { + mThumbnailUUID = sd[w]; + } } w = INV_ASSET_TYPE_LABEL; if (sd.has(w)) |