summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryfunctions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llinventoryfunctions.cpp')
-rw-r--r--indra/newview/llinventoryfunctions.cpp32
1 files changed, 26 insertions, 6 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index ca27ea8b3f..eac5661847 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -2458,12 +2458,6 @@ private:
void favorite_send(LLInventoryObject* obj, const LLUUID& obj_id, bool favorite)
{
- LLSD val;
- if (favorite)
- {
- val = true;
- } // else leave undefined to remove unneeded metadata field
-
LLSD updates;
if (favorite)
{
@@ -2517,6 +2511,13 @@ void set_favorite(const LLUUID& obj_id, bool favorite)
if (obj && obj->getIsLinkType())
{
+ if (!favorite && obj->getIsFavorite())
+ {
+ // Links currently aren't supposed to be favorites,
+ // instead should show state of the original
+ LL_INFOS("Inventory") << "Recovering proper 'favorites' state of a link " << obj_id << LL_ENDL;
+ favorite_send(obj, obj_id, false);
+ }
obj = gInventory.getObject(obj->getLinkedUUID());
}
@@ -2540,6 +2541,25 @@ void toggle_favorite(const LLUUID& obj_id)
}
}
+void toggle_favorites(const uuid_vec_t& ids)
+{
+ if (ids.size() == 0)
+ {
+ return;
+ }
+ if (ids.size() == 1)
+ {
+ toggle_favorite(ids[0]);
+ return;
+ }
+
+ bool new_val = !get_is_favorite(ids.front());
+ for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it)
+ {
+ set_favorite(*it, new_val);
+ }
+}
+
std::string get_searchable_description(LLInventoryModel* model, const LLUUID& item_id)
{
if (model)