From 740f1cd2c7229520f7765a7a7d37ea0baf563a81 Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Thu, 11 Feb 2010 19:56:54 +0200 Subject: Fixed low bug EXT-5227(Clicking online toasts should spawn IM window) --HG-- branch : product-engine --- indra/newview/llcallingcard.cpp | 17 ++++++++++++++++- indra/newview/lltoastnotifypanel.cpp | 9 +++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index 996139fccc..c3bda26aac 100644 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -63,6 +63,7 @@ #include "llviewerobjectlist.h" #include "llviewerwindow.h" #include "llvoavatar.h" +#include "llavataractions.h" ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs @@ -711,7 +712,21 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online) if(notify) { // Popup a notify box with online status of this agent - LLNotificationPtr notification = LLNotificationsUtil::add(online ? "FriendOnline" : "FriendOffline", args); + LLNotificationPtr notification; + + if (online) + { + notification = + LLNotificationsUtil::add("FriendOnline", + args, + LLSD().with("respond_on_mousedown", TRUE), + boost::bind(&LLAvatarActions::startIM, agent_id)); + } + else + { + notification = + LLNotificationsUtil::add("FriendOffline", args); + } // If there's an open IM session with this agent, send a notification there too. LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, agent_id); diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index 4d741456c4..980b51337f 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -294,6 +294,15 @@ void LLToastNotifyPanel::adjustPanelForTipNotice() mControlPanel->setVisible(FALSE); reshape(getRect().getWidth(), mInfoPanel->getRect().getHeight()); + + if (mNotification->getPayload().has("respond_on_mousedown") + && mNotification->getPayload()["respond_on_mousedown"] ) + { + mInfoPanel->setMouseDownCallback( + boost::bind(&LLNotification::respond, + mNotification, + mNotification->getResponseTemplate())); + } } // static -- cgit v1.2.3