diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2024-05-02 03:05:41 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2024-05-02 03:05:41 +0300 |
commit | fc5e5327bca83846bb97cb7ff578b0dcb3a8892e (patch) | |
tree | d2e36fb29bcbfaf0c7e726fc127e878e6b728c1f /indra/llinventory | |
parent | 645811c6ef3134a540fc1bc7d32d7bdb8fa35046 (diff) |
Viewer#1301 Implement Inventory Favorites Tab WIP#2
Diffstat (limited to 'indra/llinventory')
-rw-r--r-- | indra/llinventory/llinventory.cpp | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp index 2f701f12a0..0545c6262c 100644 --- a/indra/llinventory/llinventory.cpp +++ b/indra/llinventory/llinventory.cpp @@ -874,12 +874,20 @@ BOOL LLInventoryItem::exportLegacyStream(std::ostream& output_stream, BOOL inclu output_stream << "\t\tparent_id\t" << uuid_str << "\n"; mPermissions.exportLegacyStream(output_stream); - if (mThumbnailUUID.notNull()) + bool needs_metadata = mThumbnailUUID.notNull() || mFavorite; + if (needs_metadata) { // 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); + if (mThumbnailUUID.notNull()) + { + metadata["thumbnail"] = LLSD().with("asset_id", mThumbnailUUID); + } + if (mFavorite) + { + metadata["favorite"] = LLSD().with("toggled", mFavorite); + } output_stream << "\t\tmetadata\t"; LLSDSerialize::toXML(metadata, output_stream); @@ -1488,11 +1496,21 @@ BOOL LLInventoryCategory::exportLegacyStream(std::ostream& output_stream, BOOL) output_stream << "\t\ttype\t" << LLAssetType::lookup(mType) << "\n"; output_stream << "\t\tpref_type\t" << LLFolderType::lookup(mPreferredType) << "\n"; output_stream << "\t\tname\t" << mName.c_str() << "|\n"; - if (mThumbnailUUID.notNull()) + + bool needs_metadata = mThumbnailUUID.notNull() || mFavorite; + if (needs_metadata) { // Only up to 255 chars LLSD metadata; - metadata["thumbnail"] = LLSD().with("asset_id", mThumbnailUUID); + if (mThumbnailUUID.notNull()) + { + metadata["thumbnail"] = LLSD().with("asset_id", mThumbnailUUID); + } + if (mFavorite) + { + metadata["favorite"] = LLSD().with("toggled", mFavorite); + } + output_stream << "\t\tmetadata\t"; LLSDSerialize::toXML(metadata, output_stream); output_stream << "|\n"; |