From 90940d0b065d18b1dfaa178ee294b4d47ff96e2a Mon Sep 17 00:00:00 2001
From: Alexei Arabadji <aarabadji@productengine.com>
Date: Thu, 13 May 2010 18:49:20 +0300
Subject: [PATCH] EXT-7120 ADDITIONAL COMMIT Avoided unnecessary usage of
 LLNotificationFunctorRegistration for "ConfirmLeaveCall" notification.
 reviewed by Vadim Savchuk at
 https://codereview.productengine.com/secondlife/r/374/

--HG--
branch : product-engine
---
 indra/newview/llimfloater.cpp     | 17 ++++++++++++++++-
 indra/newview/llimfloater.h       |  2 ++
 indra/newview/llviewermessage.cpp | 15 ---------------
 3 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index d25aa37e167..3aa9d75bc0f 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -1104,6 +1104,21 @@ void LLIMFloater::closeHiddenIMToasts()
 		channel->closeHiddenToasts(IMToastMatcher());
 	}
 }
+// static
+void LLIMFloater::confirmLeaveCallCallback(const LLSD& notification, const LLSD& response)
+{
+	S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+	const LLSD& payload = notification["payload"];
+	LLUUID session_id = payload["session_id"];
+
+	LLFloater* im_floater = LLFloaterReg::findInstance("impanel", session_id);
+	if (option == 0 && im_floater != NULL)
+	{
+		im_floater->closeFloater();
+	}
+
+	return;
+}
 
 // static
 bool LLIMFloater::isChatMultiTab()
@@ -1176,7 +1191,7 @@ void	LLIMFloater::onClickCloseBtn()
 	{
 		LLSD payload;
 		payload["session_id"] = mSessionID;
-		LLNotificationsUtil::add("ConfirmLeaveCall", LLSD(), payload);
+		LLNotificationsUtil::add("ConfirmLeaveCall", LLSD(), payload, confirmLeaveCallCallback);
 		return;
 	}
 
diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h
index d63246a5cd0..fef178e3a24 100644
--- a/indra/newview/llimfloater.h
+++ b/indra/newview/llimfloater.h
@@ -155,6 +155,8 @@ class LLIMFloater : public LLTransientDockableFloater
 
 	static void closeHiddenIMToasts();
 
+	static void confirmLeaveCallCallback(const LLSD& notification, const LLSD& response);
+
 	LLPanelChatControlPanel* mControlPanel;
 	LLUUID mSessionID;
 	S32 mLastMessageIndex;
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 28c1a1ad3a1..7e741d52507 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -6475,18 +6475,3 @@ void LLOfferInfo::forceResponse(InventoryOfferResponse response)
 	LLNotifications::instance().forceResponse(params, response);
 }
 
-static bool confirm_leave_call_callback(const LLSD& notification, const LLSD& response)
-{
-	S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
-	const LLSD& payload = notification["payload"];
-	LLUUID session_id = payload["session_id"];
-
-	LLFloater* im_floater = LLFloaterReg::findInstance("impanel", session_id);
-	if (option == 0 && im_floater != NULL)
-	{
-		im_floater->closeFloater();
-	}
-
-	return false;
-}
-static LLNotificationFunctorRegistration confirm_leave_call_cb("ConfirmLeaveCall", confirm_leave_call_callback);
-- 
GitLab