summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorypanel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llinventorypanel.cpp')
-rw-r--r--indra/newview/llinventorypanel.cpp35
1 files changed, 6 insertions, 29 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index d610b920b9..6e7f62d84a 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -1367,7 +1367,9 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open)
void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, BOOL main_panel)
{
LLInventoryPanel *active_panel;
- if (main_panel)
+ bool in_inbox = (gInventory.isObjectDescendentOf(obj_id, gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX)));
+
+ if (main_panel && !in_inbox)
{
LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory")->selectAllItemsPanel();
}
@@ -1376,38 +1378,13 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L
if (active_panel)
{
LL_DEBUGS("Messaging") << "Highlighting" << obj_id << LL_ENDL;
-
- LLViewerInventoryItem * item = gInventory.getItem(obj_id);
- LLViewerInventoryCategory * cat = gInventory.getCategory(obj_id);
-
- bool in_inbox = false;
-
- LLViewerInventoryCategory * parent_cat = NULL;
-
- if (item)
- {
- parent_cat = gInventory.getCategory(item->getParentUUID());
- }
- else if (cat)
- {
- parent_cat = gInventory.getCategory(cat->getParentUUID());
- }
-
- if (parent_cat)
- {
- in_inbox = (LLFolderType::FT_INBOX == parent_cat->getPreferredType());
- }
-
+
if (in_inbox)
{
LLSidepanelInventory * sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
LLInventoryPanel * inventory_panel = NULL;
-
- if (in_inbox)
- {
- sidepanel_inventory->openInbox();
- inventory_panel = sidepanel_inventory->getInboxPanel();
- }
+ sidepanel_inventory->openInbox();
+ inventory_panel = sidepanel_inventory->getInboxPanel();
if (inventory_panel)
{