From 0782f64b642756c02ffa1ec72c2f2e5874ed26e9 Mon Sep 17 00:00:00 2001
From: Yuri Chebotarev <ychebotarev@productengine.com>
Date: Mon, 4 Jan 2010 15:42:18 +0200
Subject: [PATCH] fix for normal EXT-3763 URL clicked on nearby chat toast
 opens chat history, not URL in browser. also move real action from mouse_down
 to mouse_up (since clicking on url is processing in mouse_up).

--HG--
branch : product-engine
---
 indra/newview/llchatitemscontainerctrl.cpp | 26 ++++++++++++++++++++--
 indra/newview/llchatitemscontainerctrl.h   |  1 +
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp
index 92df2813073..60a37ac4af9 100644
--- a/indra/newview/llchatitemscontainerctrl.cpp
+++ b/indra/newview/llchatitemscontainerctrl.cpp
@@ -252,11 +252,33 @@ void LLNearbyChatToastPanel::onMouseEnter				(S32 x, S32 y, MASK mask)
 }
 
 BOOL	LLNearbyChatToastPanel::handleMouseDown	(S32 x, S32 y, MASK mask)
+{
+	return LLPanel::handleMouseDown(x,y,mask);
+}
+
+BOOL	LLNearbyChatToastPanel::handleMouseUp	(S32 x, S32 y, MASK mask)
 {
 	if(mSourceType != CHAT_SOURCE_AGENT)
-		return LLPanel::handleMouseDown(x,y,mask);
+		return LLPanel::handleMouseUp(x,y,mask);
+
+	LLChatMsgBox* text_box = getChild<LLChatMsgBox>("msg_text", false);
+	S32 local_x = x - text_box->getRect().mLeft;
+	S32 local_y = y - text_box->getRect().mBottom;
+	
+	//if text_box process mouse up (ussually this is click on url) - we didn't show nearby_chat.
+	if (text_box->pointInView(local_x, local_y) )
+	{
+		if (text_box->handleMouseUp(local_x,local_y,mask) == TRUE)
+			return TRUE;
+		else
+		{
+			LLFloaterReg::showInstance("nearby_chat",LLSD());
+			return FALSE;
+		}
+	}
+
 	LLFloaterReg::showInstance("nearby_chat",LLSD());
-	return LLPanel::handleMouseDown(x,y,mask);
+	return LLPanel::handleMouseUp(x,y,mask);
 }
 
 void	LLNearbyChatToastPanel::setHeaderVisibility(EShowItemHeader e)
diff --git a/indra/newview/llchatitemscontainerctrl.h b/indra/newview/llchatitemscontainerctrl.h
index 0a85c524015..f4b86550541 100644
--- a/indra/newview/llchatitemscontainerctrl.h
+++ b/indra/newview/llchatitemscontainerctrl.h
@@ -68,6 +68,7 @@ class LLNearbyChatToastPanel: public LLToastPanelBase
 	void	onMouseLeave	(S32 x, S32 y, MASK mask);
 	void	onMouseEnter	(S32 x, S32 y, MASK mask);
 	BOOL	handleMouseDown	(S32 x, S32 y, MASK mask);
+	BOOL	handleMouseUp	(S32 x, S32 y, MASK mask);
 
 	virtual BOOL postBuild();
 
-- 
GitLab