SL-20187 [AIS3] Don't fill thumbnail field if null thumbnail is set

meow-7.2.2
Andrey Kleshchev 2023-08-22 21:14:06 +03:00
parent d882609973
commit 4b5b048cb6
2 changed files with 18 additions and 3 deletions

View File

@ -1140,7 +1140,14 @@ LLSD LLInventoryCategory::asAISLLSD() const
S8 type = static_cast<S8>(mPreferredType);
sd[INV_ASSET_TYPE_LABEL_WS] = type;
sd[INV_NAME_LABEL] = mName;
sd[INV_THUMBNAIL_LABEL] = LLSD().with(INV_ASSET_ID_LABEL, mThumbnailUUID);
if (mThumbnailUUID.notNull())
{
sd[INV_THUMBNAIL_LABEL] = LLSD().with(INV_ASSET_ID_LABEL, mThumbnailUUID);
}
else
{
sd[INV_THUMBNAIL_LABEL] = LLSD();
}
return sd;
}

View File

@ -787,8 +787,16 @@ void LLFloaterChangeItemThumbnail::setThumbnailId(const LLUUID& new_thumbnail_id
if (obj->getThumbnailUUID() != new_thumbnail_id)
{
LLSD updates;
// At the moment server expects id as a string
updates["thumbnail"] = LLSD().with("asset_id", new_thumbnail_id.asString());
if (new_thumbnail_id.notNull())
{
// At the moment server expects id as a string
updates["thumbnail"] = LLSD().with("asset_id", new_thumbnail_id.asString());
}
else
{
// No thumbnail isntead of 'null id thumbnail'
updates["thumbnail"] = LLSD();
}
LLViewerInventoryCategory* view_folder = dynamic_cast<LLViewerInventoryCategory*>(obj);
if (view_folder)
{