From c5c72899f3f9e203474d8635aa05e154ee14add9 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Tue, 23 Mar 2010 10:10:15 +0200 Subject: Fixed normal subtask EXT-6441 - Do not show "friendship accepted" toast if respective IM window is open and in focus. Minor changes to supress toast for FriendshipAccepted notification. --HG-- branch : product-engine --- indra/newview/llnotificationhandlerutil.cpp | 54 +++++++++++++++++++++++------ 1 file changed, 44 insertions(+), 10 deletions(-) (limited to 'indra/newview/llnotificationhandlerutil.cpp') diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index d3ad61128d..24cffd222b 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -193,10 +193,36 @@ bool LLHandlerUtil::canSpawnSessionAndLogToIM(const LLNotificationPtr& notificat // static bool LLHandlerUtil::canSpawnToast(const LLNotificationPtr& notification) { - bool cannot_spawn = isIMFloaterOpened(notification) && (INVENTORY_DECLINED == notification->getName() - || INVENTORY_ACCEPTED == notification->getName()); - - return !cannot_spawn; + if(INVENTORY_DECLINED == notification->getName() + || INVENTORY_ACCEPTED == notification->getName()) + { + // return false for inventory accepted/declined notifications if respective IM window is open (EXT-5909) + return ! isIMFloaterOpened(notification); + } + + if(FRIENDSHIP_ACCEPTED == notification->getName()) + { + // don't show FRIENDSHIP_ACCEPTED if IM window is opened and focused - EXT-6441 + return ! isIMFloaterFocused(notification); + } + + if(OFFER_FRIENDSHIP == notification->getName() + || USER_GIVE_ITEM == notification->getName() + || TELEPORT_OFFERED == notification->getName()) + { + // When ANY offer arrives, show toast, unless IM window is already open - EXT-5904 + return ! isIMFloaterOpened(notification); + } + + return true; +} + +// static +LLIMFloater* LLHandlerUtil::findIMFloater(const LLNotificationPtr& notification) +{ + LLUUID from_id = notification->getPayload()["from_id"]; + LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, from_id); + return LLFloaterReg::findTypedInstance("impanel", session_id); } // static @@ -204,12 +230,7 @@ bool LLHandlerUtil::isIMFloaterOpened(const LLNotificationPtr& notification) { bool res = false; - LLUUID from_id = notification->getPayload()["from_id"]; - LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, - from_id); - - LLIMFloater* im_floater = LLFloaterReg::findTypedInstance( - "impanel", session_id); + LLIMFloater* im_floater = findIMFloater(notification); if (im_floater != NULL) { res = im_floater->getVisible() == TRUE; @@ -218,6 +239,19 @@ bool LLHandlerUtil::isIMFloaterOpened(const LLNotificationPtr& notification) return res; } +bool LLHandlerUtil::isIMFloaterFocused(const LLNotificationPtr& notification) +{ + bool res = false; + + LLIMFloater* im_floater = findIMFloater(notification); + if (im_floater != NULL) + { + res = im_floater->hasFocus() == TRUE; + } + + return res; +} + // static void LLHandlerUtil::logToIM(const EInstantMessage& session_type, const std::string& session_name, const std::string& from_name, -- cgit v1.2.3 From 54a3f1051e5ef411b39ac34ba37fc7444832a3eb Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Thu, 25 Mar 2010 17:53:25 +0200 Subject: =?UTF-8?q?fixed=20EXT-6489=20=E2=80=9C"User=20not=20online=20-=20?= =?UTF-8?q?inventory=20has=20been=20saved"=20should=20be=20logged=20to=20I?= =?UTF-8?q?M=20log=E2=80=9D,=20reviewed=20by=20Mike=20Antipov=20at=20https?= =?UTF-8?q?://codereview.productengine.com/secondlife/r/90/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/llnotificationhandlerutil.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'indra/newview/llnotificationhandlerutil.cpp') diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 24cffd222b..6aafa04a17 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -128,7 +128,8 @@ const static std::string GRANTED_MODIFY_RIGHTS("GrantedModifyRights"), FRIEND_ONLINE("FriendOnline"), FRIEND_OFFLINE("FriendOffline"), SERVER_OBJECT_MESSAGE("ServerObjectMessage"), TELEPORT_OFFERED("TeleportOffered"), - TELEPORT_OFFER_SENT("TeleportOfferSent"); + TELEPORT_OFFER_SENT("TeleportOfferSent"), + IM_SYSTEM_MESSAGE_TIP("IMSystemMessageTip"); // static @@ -147,7 +148,8 @@ bool LLHandlerUtil::canLogToIM(const LLNotificationPtr& notification) || INVENTORY_DECLINED == notification->getName() || USER_GIVE_ITEM == notification->getName() || TELEPORT_OFFERED == notification->getName() - || TELEPORT_OFFER_SENT == notification->getName(); + || TELEPORT_OFFER_SENT == notification->getName() + || IM_SYSTEM_MESSAGE_TIP == notification->getName(); } // static @@ -157,7 +159,8 @@ bool LLHandlerUtil::canLogToNearbyChat(const LLNotificationPtr& notification) && FRIEND_ONLINE != notification->getName() && FRIEND_OFFLINE != notification->getName() && INVENTORY_ACCEPTED != notification->getName() - && INVENTORY_DECLINED != notification->getName(); + && INVENTORY_DECLINED != notification->getName() + && IM_SYSTEM_MESSAGE_TIP != notification->getName(); } // static -- cgit v1.2.3 From 4992eaf27dd113df805f347811882e72df6d7a86 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Thu, 1 Apr 2010 15:24:36 +0300 Subject: fixed EXT-2801 Record "object return" notification into IM history, not chat history, * added class for LLPostponedNotification to rpovide possibility postpone adding notification to notifications system till sender avatar name will be received from cache name; * rolled back changes related to fix of EXT-4779; * avoided passing avatar id when logging 'Object Return' notification to nearby chat; eviewed by Vadim Savchuk at https://jira.secondlife.com/browse/EXT-6373 --HG-- branch : product-engine --- indra/newview/llnotificationhandlerutil.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'indra/newview/llnotificationhandlerutil.cpp') diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 6aafa04a17..3f551f6b32 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -323,7 +323,7 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification, bool to_fi { const std::string name = LLHandlerUtil::getSubstitutionName(notification); - std::string session_name = notification->getPayload().has( + const std::string& session_name = notification->getPayload().has( "SESSION_NAME") ? notification->getPayload()["SESSION_NAME"].asString() : name; // don't create IM p2p session with objects, it's necessary condition to log @@ -332,12 +332,6 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification, bool to_fi { LLUUID from_id = notification->getPayload()["from_id"]; - //*HACK for ServerObjectMessage the sesson name is really weird, see EXT-4779 - if (SERVER_OBJECT_MESSAGE == notification->getName()) - { - session_name = "chat"; - } - //there still appears a log history file with weird name " .txt" if (" " == session_name || "{waiting}" == session_name || "{nobody}" == session_name) { @@ -392,6 +386,7 @@ void LLHandlerUtil::logToNearbyChat(const LLNotificationPtr& notification, EChat LLChat chat_msg(notification->getMessage()); chat_msg.mSourceType = type; chat_msg.mFromName = SYSTEM_FROM; + chat_msg.mFromID = LLUUID::null; nearby_chat->addMessage(chat_msg); } } -- cgit v1.2.3