summaryrefslogtreecommitdiff
path: root/indra/llinventory
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-04-24 19:28:15 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-04-24 19:28:15 +0300
commit85f2447b3ddf7e4b91cd5963cb2e7668d48ab2a9 (patch)
tree494487bbc57c79d17921b7443003d2a118e24ddb /indra/llinventory
parent398369233fc2621eb447701e26082057fb0c97d7 (diff)
parentd98fc504a1d4bc292ba86acdda053c8b4598a193 (diff)
Merge branch 'main' into marchcat/a-merge
# Conflicts: # autobuild.xml # indra/llimage/llimage.cpp # indra/llui/llsearcheditor.cpp # indra/llui/llview.cpp # indra/newview/llagent.cpp # indra/newview/llappviewer.cpp # indra/newview/llfloatercamera.cpp # indra/newview/llfloatereditsky.cpp # indra/newview/llfloatereditwater.cpp # indra/newview/llinventoryfunctions.cpp # indra/newview/lloutfitgallery.cpp # indra/newview/lloutfitslist.cpp # indra/newview/llpanelgroupbulkban.cpp # indra/newview/llsidepanelappearance.cpp # indra/newview/llvovolume.cpp
Diffstat (limited to 'indra/llinventory')
-rw-r--r--indra/llinventory/llinventory.cpp55
1 files changed, 50 insertions, 5 deletions
diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp
index 873f214f70..d220731f6a 100644
--- a/indra/llinventory/llinventory.cpp
+++ b/indra/llinventory/llinventory.cpp
@@ -32,6 +32,7 @@
#include "llinventorydefines.h"
#include "llxorcipher.h"
#include "llsd.h"
+#include "llsdserialize.h"
#include "message.h"
#include <boost/tokenizer.hpp>
@@ -217,7 +218,19 @@ bool LLInventoryObject::importLegacyStream(std::istream& input_stream)
}
else if (0 == strcmp("metadata", keyword))
{
- LLSD metadata(valuestr);
+ LLSD metadata;
+ if (strncmp("<llsd>", valuestr, 6) == 0)
+ {
+ std::istringstream stream(valuestr);
+ LLSDSerialize::fromXML(metadata, stream);
+ }
+ else
+ {
+ // next line likely contains metadata, but at the moment is not supported
+ // can do something like:
+ // LLSDSerialize::fromNotation(metadata, input_stream, -1);
+ }
+
if (metadata.has("thumbnail"))
{
const LLSD& thumbnail = metadata["thumbnail"];
@@ -693,7 +706,19 @@ bool LLInventoryItem::importLegacyStream(std::istream& input_stream)
}
else if (0 == strcmp("metadata", keyword))
{
- LLSD metadata(valuestr);
+ LLSD metadata;
+ if (strncmp("<llsd>", valuestr, 6) == 0)
+ {
+ std::istringstream stream(valuestr);
+ LLSDSerialize::fromXML(metadata, stream);
+ }
+ else
+ {
+ // next line likely contains metadata, but at the moment is not supported
+ // can do something like:
+ // LLSDSerialize::fromNotation(metadata, input_stream, -1);
+ }
+
if (metadata.has("thumbnail"))
{
const LLSD& thumbnail = metadata["thumbnail"];
@@ -802,9 +827,14 @@ bool LLInventoryItem::exportLegacyStream(std::ostream& output_stream, bool inclu
if (mThumbnailUUID.notNull())
{
+ // Max length is 255 chars, will have to export differently if it gets more data
+ // Ex: use newline and toNotation (uses {}) for unlimited size
LLSD metadata;
metadata["thumbnail"] = LLSD().with("asset_id", mThumbnailUUID);
- output_stream << "\t\tmetadata\t" << metadata << "|\n";
+
+ output_stream << "\t\tmetadata\t";
+ LLSDSerialize::toXML(metadata, output_stream);
+ output_stream << "|\n";
}
// Check for permissions to see the asset id, and if so write it
@@ -1303,7 +1333,19 @@ bool LLInventoryCategory::importLegacyStream(std::istream& input_stream)
}
else if (0 == strcmp("metadata", keyword))
{
- LLSD metadata(valuestr);
+ LLSD metadata;
+ if (strncmp("<llsd>", valuestr, 6) == 0)
+ {
+ std::istringstream stream(valuestr);
+ LLSDSerialize::fromXML(metadata, stream);
+ }
+ else
+ {
+ // next line likely contains metadata, but at the moment is not supported
+ // can do something like:
+ // LLSDSerialize::fromNotation(metadata, input_stream, -1);
+ }
+
if (metadata.has("thumbnail"))
{
const LLSD& thumbnail = metadata["thumbnail"];
@@ -1343,9 +1385,12 @@ bool LLInventoryCategory::exportLegacyStream(std::ostream& output_stream, bool)
output_stream << "\t\tname\t" << mName.c_str() << "|\n";
if (mThumbnailUUID.notNull())
{
+ // Only up to 255 chars
LLSD metadata;
metadata["thumbnail"] = LLSD().with("asset_id", mThumbnailUUID);
- output_stream << "\t\tmetadata\t" << metadata << "|\n";
+ output_stream << "\t\tmetadata\t";
+ LLSDSerialize::toXML(metadata, output_stream);
+ output_stream << "|\n";
}
output_stream << "\t}\n";
return true;