summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-03-10 20:15:41 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-03-10 20:19:14 +0200
commit80b33a015735daf08b8904b3581b3edcce9368d3 (patch)
tree78d1c9bf01401929a22af8f30af6ade23e1b98c4 /indra
parentff6ff01c6a3822c8160279fecd3c3f2e636c4349 (diff)
SL-18629 Unpack thumbnail asset id
Diffstat (limited to 'indra')
-rw-r--r--indra/llinventory/llinventory.cpp56
-rw-r--r--indra/newview/llinventorymodel.cpp1
2 files changed, 55 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))
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 774ed051c0..bfff876c96 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -193,6 +193,7 @@ public:
titem->unpackMessage(item);
LL_DEBUGS("Inventory") << "unpacked item '" << titem->getName() << "' in "
<< titem->getParentUUID() << LL_ENDL;
+ // callback id might be no longer supported
U32 callback_id = item["callback_id"].asInteger();
if (titem->getUUID().notNull())