summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorymodel.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2011-08-04 15:45:48 -0700
committerMerov Linden <merov@lindenlab.com>2011-08-04 15:45:48 -0700
commit7cc7d143837f2b75f750c139e33fdf5afa8a8866 (patch)
tree7e37843f06cdd1f163258b5686ac29943aa8558d /indra/newview/llinventorymodel.cpp
parent1b46240ed84e2847dbf7da0d67c67940b646448c (diff)
parent0b81c19cbe809f041e628da334c305ea33fae2e9 (diff)
Sync with viewer-development
Diffstat (limited to 'indra/newview/llinventorymodel.cpp')
-rw-r--r--indra/newview/llinventorymodel.cpp88
1 files changed, 65 insertions, 23 deletions
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 21d5de9a5b..e86c427ae2 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -2168,6 +2168,9 @@ void LLInventoryModel::registerCallbacks(LLMessageSystem* msg)
msg->setHandlerFuncFast(_PREHASH_RemoveInventoryFolder,
processRemoveInventoryFolder,
NULL);
+ msg->setHandlerFuncFast(_PREHASH_RemoveInventoryObjects,
+ processRemoveInventoryObjects,
+ NULL);
//msg->setHandlerFuncFast(_PREHASH_ExchangeCallingCard,
// processExchangeCallingcard,
// NULL);
@@ -2284,26 +2287,21 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account)
}
// static
-void LLInventoryModel::processRemoveInventoryItem(LLMessageSystem* msg, void**)
+void LLInventoryModel::removeInventoryItem(LLUUID agent_id, LLMessageSystem* msg, const char* msg_label)
{
- lldebugs << "LLInventoryModel::processRemoveInventoryItem()" << llendl;
- LLUUID agent_id, item_id;
- msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id);
- if(agent_id != gAgent.getID())
- {
- llwarns << "Got a RemoveInventoryItem for the wrong agent."
- << llendl;
- return;
- }
- S32 count = msg->getNumberOfBlocksFast(_PREHASH_InventoryData);
+ LLUUID item_id;
+ S32 count = msg->getNumberOfBlocksFast(msg_label);
+ lldebugs << "Message has " << count << " item blocks" << llendl;
uuid_vec_t item_ids;
update_map_t update;
for(S32 i = 0; i < count; ++i)
{
- msg->getUUIDFast(_PREHASH_InventoryData, _PREHASH_ItemID, item_id, i);
+ msg->getUUIDFast(msg_label, _PREHASH_ItemID, item_id, i);
+ lldebugs << "Checking for item-to-be-removed " << item_id << llendl;
LLViewerInventoryItem* itemp = gInventory.getItem(item_id);
if(itemp)
{
+ lldebugs << "Item will be removed " << item_id << llendl;
// we only bother with the delete and account if we found
// the item - this is usually a back-up for permissions,
// so frequently the item will already be gone.
@@ -2314,8 +2312,24 @@ void LLInventoryModel::processRemoveInventoryItem(LLMessageSystem* msg, void**)
gInventory.accountForUpdate(update);
for(uuid_vec_t::iterator it = item_ids.begin(); it != item_ids.end(); ++it)
{
+ lldebugs << "Calling deleteObject " << *it << llendl;
gInventory.deleteObject(*it);
}
+}
+
+// static
+void LLInventoryModel::processRemoveInventoryItem(LLMessageSystem* msg, void**)
+{
+ lldebugs << "LLInventoryModel::processRemoveInventoryItem()" << llendl;
+ LLUUID agent_id, item_id;
+ msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id);
+ if(agent_id != gAgent.getID())
+ {
+ llwarns << "Got a RemoveInventoryItem for the wrong agent."
+ << llendl;
+ return;
+ }
+ LLInventoryModel::removeInventoryItem(agent_id, msg, _PREHASH_InventoryData);
gInventory.notifyObservers();
}
@@ -2380,18 +2394,10 @@ void LLInventoryModel::processUpdateInventoryFolder(LLMessageSystem* msg,
}
// static
-void LLInventoryModel::processRemoveInventoryFolder(LLMessageSystem* msg,
- void**)
+void LLInventoryModel::removeInventoryFolder(LLUUID agent_id,
+ LLMessageSystem* msg)
{
- lldebugs << "LLInventoryModel::processRemoveInventoryFolder()" << llendl;
- LLUUID agent_id, folder_id;
- msg->getUUIDFast(_PREHASH_FolderData, _PREHASH_AgentID, agent_id);
- if(agent_id != gAgent.getID())
- {
- llwarns << "Got a RemoveInventoryFolder for the wrong agent."
- << llendl;
- return;
- }
+ LLUUID folder_id;
uuid_vec_t folder_ids;
update_map_t update;
S32 count = msg->getNumberOfBlocksFast(_PREHASH_FolderData);
@@ -2410,6 +2416,42 @@ void LLInventoryModel::processRemoveInventoryFolder(LLMessageSystem* msg,
{
gInventory.deleteObject(*it);
}
+}
+
+// static
+void LLInventoryModel::processRemoveInventoryFolder(LLMessageSystem* msg,
+ void**)
+{
+ lldebugs << "LLInventoryModel::processRemoveInventoryFolder()" << llendl;
+ LLUUID agent_id, session_id;
+ msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id);
+ msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_SessionID, session_id);
+ if(agent_id != gAgent.getID())
+ {
+ llwarns << "Got a RemoveInventoryFolder for the wrong agent."
+ << llendl;
+ return;
+ }
+ LLInventoryModel::removeInventoryFolder( agent_id, msg );
+ gInventory.notifyObservers();
+}
+
+// static
+void LLInventoryModel::processRemoveInventoryObjects(LLMessageSystem* msg,
+ void**)
+{
+ lldebugs << "LLInventoryModel::processRemoveInventoryObjects()" << llendl;
+ LLUUID agent_id, session_id;
+ msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id);
+ msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_SessionID, session_id);
+ if(agent_id != gAgent.getID())
+ {
+ llwarns << "Got a RemoveInventoryObjects for the wrong agent."
+ << llendl;
+ return;
+ }
+ LLInventoryModel::removeInventoryFolder( agent_id, msg );
+ LLInventoryModel::removeInventoryItem( agent_id, msg, _PREHASH_ItemData );
gInventory.notifyObservers();
}