From 55f1a96dbf59b0bf1d0d87f358392f31b24741bf Mon Sep 17 00:00:00 2001
From: Igor Borovkov <iborovkov@productengine.com>
Date: Thu, 25 Feb 2010 17:40:40 +0200
Subject: fixed EXT-5731 Viewer 2: New chat format doesn't recognise scripted
 object name changes

--HG--
branch : product-engine
---
 indra/newview/llchatitemscontainerctrl.cpp | 1 +
 indra/newview/llchatitemscontainerctrl.h   | 3 +++
 indra/newview/llnearbychathandler.cpp      | 3 ++-
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp
index e164aa8fc4..81edb55f93 100644
--- a/indra/newview/llchatitemscontainerctrl.cpp
+++ b/indra/newview/llchatitemscontainerctrl.cpp
@@ -144,6 +144,7 @@ void LLNearbyChatToastPanel::init(LLSD& notification)
 	std::string		messageText = notification["message"].asString();		// UTF-8 line of text
 	std::string		fromName = notification["from"].asString();	// agent or object name
 	mFromID = notification["from_id"].asUUID();		// agent id or object id
+	mFromName = fromName;
 	
 	int sType = notification["source"].asInteger();
     mSourceType = (EChatSourceType)sType;
diff --git a/indra/newview/llchatitemscontainerctrl.h b/indra/newview/llchatitemscontainerctrl.h
index 4d730573d9..b28c9dbc4b 100644
--- a/indra/newview/llchatitemscontainerctrl.h
+++ b/indra/newview/llchatitemscontainerctrl.h
@@ -60,6 +60,7 @@ public:
 	static LLNearbyChatToastPanel* createInstance();
 
 	const LLUUID& getFromID() const { return mFromID;}
+	const std::string& getFromName() const { return mFromName; }
 	
 	//void	addText		(const std::string& message ,  const LLStyle::Params& input_params = LLStyle::Params());
 	//void	setMessage	(const LLChat& msg);
@@ -84,9 +85,11 @@ public:
 
 	virtual void draw();
 
+	//*TODO REMOVE, why a dup of getFromID?
 	const LLUUID&	messageID() const { return mFromID;}
 private:
 	LLUUID			mFromID;	// agent id or object id
+	std::string		mFromName;
 	EChatSourceType	mSourceType;
 	
 
diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp
index a211adc79d..08ae93c3a6 100644
--- a/indra/newview/llnearbychathandler.cpp
+++ b/indra/newview/llnearbychathandler.cpp
@@ -176,10 +176,11 @@ void LLNearbyChatScreenChannel::addNotification(LLSD& notification)
 	if(m_active_toasts.size())
 	{
 		LLUUID fromID = notification["from_id"].asUUID();		// agent id or object id
+		std::string from = notification["from"].asString();
 		LLToast* toast = m_active_toasts[0];
 		LLNearbyChatToastPanel* panel = dynamic_cast<LLNearbyChatToastPanel*>(toast->getPanel());
 
-		if(panel && panel->messageID() == fromID && panel->canAddText())
+		if(panel && panel->messageID() == fromID && panel->getFromName() == from && panel->canAddText())
 		{
 			panel->addMessage(notification);
 			toast->reshapeToPanel();
-- 
cgit v1.2.3