diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-04-07 21:01:00 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-04-07 21:02:10 +0300 |
commit | bb4967817e5e0251ebcbae861fcd998f22ce0c0c (patch) | |
tree | 699f5fe4141a43ec49f67b791862bae066de224f /indra/llinventory | |
parent | 43ff8108f2d056b84ab2a7586951ad363c350f05 (diff) |
SL-18918 Fix folder type when creating folders
Might be better to replace "type" with "type_default" everywere, not just for AIS
Diffstat (limited to 'indra/llinventory')
-rw-r--r-- | indra/llinventory/llinventory.cpp | 25 | ||||
-rw-r--r-- | indra/llinventory/llinventory.h | 1 |
2 files changed, 22 insertions, 4 deletions
diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp index c6049f3ec4..ef86d2d89b 100644 --- a/indra/llinventory/llinventory.cpp +++ b/indra/llinventory/llinventory.cpp @@ -1098,11 +1098,28 @@ void LLInventoryCategory::setPreferredType(LLFolderType::EType type) LLSD LLInventoryCategory::asLLSD() const { LLSD sd = LLSD(); - sd["item_id"] = mUUID; - sd["parent_id"] = mParentUUID; + sd[INV_ITEM_ID_LABEL] = mUUID; + sd[INV_PARENT_ID_LABEL] = mParentUUID; S8 type = static_cast<S8>(mPreferredType); - sd["type"] = type; - sd["name"] = mName; + sd[INV_ASSET_TYPE_LABEL] = type; + sd[INV_NAME_LABEL] = mName; + + if (mThumbnailUUID.notNull()) + { + sd[INV_THUMBNAIL_LABEL] = LLSD().with(INV_ASSET_ID_LABEL, mThumbnailUUID); + } + + return sd; +} + +LLSD LLInventoryCategory::asAISLLSD() const +{ + LLSD sd = LLSD(); + sd[INV_FOLDER_ID_LABEL_WS] = mUUID; + sd[INV_PARENT_ID_LABEL] = mParentUUID; + S8 type = static_cast<S8>(mPreferredType); + sd[INV_ASSET_TYPE_LABEL_WS] = type; + sd[INV_NAME_LABEL] = mName; if (mThumbnailUUID.notNull()) { diff --git a/indra/llinventory/llinventory.h b/indra/llinventory/llinventory.h index dfe8b7659b..516cfc6a24 100644 --- a/indra/llinventory/llinventory.h +++ b/indra/llinventory/llinventory.h @@ -253,6 +253,7 @@ public: LLFolderType::EType getPreferredType() const; void setPreferredType(LLFolderType::EType type); LLSD asLLSD() const; + LLSD asAISLLSD() const; bool fromLLSD(const LLSD& sd); //-------------------------------------------------------------------- |