summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryfunctions.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-05-09 23:22:26 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-05-09 23:50:02 +0300
commita420e84f4822d19388241f99a916dacc4d1eab61 (patch)
treebf6c185584af53cc183434cc35cbf77d1a426ae9 /indra/newview/llinventoryfunctions.cpp
parent5c78396b64c985a7e58d045ff3f343bccc81c8d3 (diff)
viewer#1424 Favorites in Appearance floater #2
Diffstat (limited to 'indra/newview/llinventoryfunctions.cpp')
-rw-r--r--indra/newview/llinventoryfunctions.cpp28
1 files changed, 26 insertions, 2 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 604adea125..123d47b474 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -2364,8 +2364,21 @@ void set_favorite(const LLUUID& obj_id, bool favorite)
LLInventoryObject* obj = gInventory.getObject(obj_id);
if (obj->getIsFavorite() != favorite)
{
+ LLSD val;
+ if (favorite)
+ {
+ val = true;
+ } // else leave undefined to remove unneeded metadata field
+
LLSD updates;
- updates["favorite"] = LLSD().with("toggled", favorite);
+ if (favorite)
+ {
+ updates["favorite"] = LLSD().with("toggled", true);
+ }
+ else
+ {
+ updates["favorite"] = LLSD();
+ }
LLPointer<LLInventoryCallback> cb = new LLUpdateFavorite(obj_id);
@@ -2385,9 +2398,20 @@ void set_favorite(const LLUUID& obj_id, bool favorite)
void toggle_favorite(const LLUUID& obj_id)
{
LLInventoryObject* obj = gInventory.getObject(obj_id);
+ if (!obj)
+ {
+ return;
+ }
LLSD updates;
- updates["favorite"] = LLSD().with("toggled", !obj->getIsFavorite());
+ if (!obj->getIsFavorite())
+ {
+ updates["favorite"] = LLSD().with("toggled", true);
+ }
+ else
+ {
+ updates["favorite"] = LLSD();
+ }
LLPointer<LLInventoryCallback> cb = new LLUpdateFavorite(obj_id);