Commits

Seth ProductEngine committed 354916d

STORM-1042 FIXED Fixed the inventory observers of newly added items.
The problem was caused by an outdated message name stored in LLInventoryObserver::mMessageName and not updated properly in LLInventoryModel::notifyObservers().
The message name used in LLInventoryAddedObserver::changed() was the name of the message most recently passed by LLInventoryModel::notifyObservers(), instead of the name of the latest actually received message. Using the most recent message name in this case fixed the problem.

Comments (0)

Files changed (5)

indra/newview/llinventorymodel.cpp

 	{
 		return;
 	}
-	notifyObservers("");
+	notifyObservers();
 }
 
 // Call this method when it's time to update everyone on a new state.
-// The optional argument 'service_name' is used by Agent Inventory Service [DEV-20328]
-void LLInventoryModel::notifyObservers(const std::string service_name)
+void LLInventoryModel::notifyObservers()
 {
 	if (mIsNotifyObservers)
 	{
 	{
 		LLInventoryObserver* observer = *iter;
 		
-		if (service_name.empty())
-		{
-			observer->changed(mModifyMask);
-		}
-		else
-		{
-			observer->mMessageName = service_name;
-			observer->changed(mModifyMask);
-		}
+		observer->changed(mModifyMask);
 
 		// safe way to increment since changed may delete entries! (@!##%@!@&*!)
 		iter = mObservers.upper_bound(observer); 
 	{
 		changes |= gInventory.updateItem(*it);
 	}
-	gInventory.notifyObservers("fetchinventory");
+	gInventory.notifyObservers();
 	gViewerWindow->getWindow()->decBusyCount();
 }
 
 {
 	llinfos << "fetchInventory::error "
 		<< status << ": " << reason << llendl;
-	gInventory.notifyObservers("fetchinventory");
+	gInventory.notifyObservers();
 }
 
 bool LLInventoryModel::fetchDescendentsOf(const LLUUID& folder_id) const

indra/newview/llinventorymodel.h

 	// has been indicated.
 	void idleNotifyObservers();
 
-	// Call to explicitly update everyone on a new state.  The optional argument
-	// 'service_name' is used by Agent Inventory Service [DEV-20328]
-	void notifyObservers(const std::string service_name="");
+	// Call to explicitly update everyone on a new state.
+	void notifyObservers();
 
 	// Allows outsiders to tell the inventory if something has
 	// been changed 'under the hood', but outside the control of the

indra/newview/llinventorymodelbackgroundfetch.cpp

                         titem->setParent(lost_uuid);
                         titem->updateParentOnServer(FALSE);
                         gInventory.updateItem(titem);
-                        gInventory.notifyObservers("fetchDescendents");
+                        gInventory.notifyObservers();
                         
                     }
                 }
 		fetcher->setAllFoldersFetched();
 	}
 	
-	gInventory.notifyObservers("fetchDescendents");
+	gInventory.notifyObservers();
 }
 
 // If we get back an error (not found, etc...), handle it here.
 			fetcher->setAllFoldersFetched();
 		}
 	}
-	gInventory.notifyObservers("fetchDescendents");
+	gInventory.notifyObservers();
 }
 
 BOOL LLInventoryModelFetchDescendentsResponder::getIsRecursive(const LLUUID& cat_id) const

indra/newview/llinventoryobserver.cpp

 	// the network, figure out which item was updated.
 	LLMessageSystem* msg = gMessageSystem;
 
-	std::string msg_name;
-	if (mMessageName.empty())
-	{
-		msg_name = msg->getMessageName();
-	}
-	else
-	{
-		msg_name = mMessageName;
-	}
-
+	std::string msg_name = msg->getMessageName();
 	if (msg_name.empty())
 	{
 		return;

indra/newview/llinventoryobserver.h

 	LLInventoryObserver();
 	virtual ~LLInventoryObserver();
 	virtual void changed(U32 mask) = 0;
-	std::string mMessageName; // used by Agent Inventory Service only. [DEV-20328]
 };
 
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~