From f54bf2a1eac3bc61222e5cceba77755bd340f996 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Thu, 4 Mar 2010 11:35:34 +0200 Subject: =?UTF-8?q?fixed=20EXT-5904=20=E2=80=9COffers=20embedding=20into?= =?UTF-8?q?=20IM=20windows=E2=80=9D,=20made=20all=20type=20offers=20be=20e?= =?UTF-8?q?mbedded=20to=20the=20IM=20floater;=20made=20showing=20offer=20t?= =?UTF-8?q?oast=20if=20IM=20floater=20isn't=20visible;=20corrected=20IM=20?= =?UTF-8?q?message=20counter=20on=20showing=20offer=20toast;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/llnotificationhandlerutil.cpp | 73 ++++++++++++++++++++++++++--- 1 file changed, 67 insertions(+), 6 deletions(-) (limited to 'indra/newview/llnotificationhandlerutil.cpp') diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 546017f028..1a30eecf01 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -127,7 +127,9 @@ const static std::string GRANTED_MODIFY_RIGHTS("GrantedModifyRights"), FRIENDSHIP_DECLINED_BYME("FriendshipDeclinedByMe"), FRIEND_ONLINE("FriendOnline"), FRIEND_OFFLINE("FriendOffline"), SERVER_OBJECT_MESSAGE("ServerObjectMessage"), - TELEPORT_OFFERED("TeleportOffered"); + TELEPORT_OFFERED("TeleportOffered"), + TELEPORT_OFFER_SENT("TeleportOfferSent"); + // static bool LLHandlerUtil::canLogToIM(const LLNotificationPtr& notification) @@ -141,7 +143,10 @@ bool LLHandlerUtil::canLogToIM(const LLNotificationPtr& notification) || FRIENDSHIP_DECLINED_BYME == notification->getName() || SERVER_OBJECT_MESSAGE == notification->getName() || INVENTORY_ACCEPTED == notification->getName() - || INVENTORY_DECLINED == notification->getName(); + || INVENTORY_DECLINED == notification->getName() + || USER_GIVE_ITEM == notification->getName() + || TELEPORT_OFFERED == notification->getName() + || TELEPORT_OFFER_SENT == notification->getName(); } // static @@ -161,23 +166,43 @@ bool LLHandlerUtil::canSpawnIMSession(const LLNotificationPtr& notification) || FRIENDSHIP_ACCEPTED == notification->getName() || USER_GIVE_ITEM == notification->getName() || INVENTORY_ACCEPTED == notification->getName() - || INVENTORY_DECLINED == notification->getName(); + || INVENTORY_DECLINED == notification->getName() + || TELEPORT_OFFERED == notification->getName(); } // static bool LLHandlerUtil::canAddNotifPanelToIM(const LLNotificationPtr& notification) { return OFFER_FRIENDSHIP == notification->getName() - || USER_GIVE_ITEM == notification->getName(); + || USER_GIVE_ITEM == notification->getName() + || TELEPORT_OFFERED == notification->getName(); } - // static bool LLHandlerUtil::canSpawnSessionAndLogToIM(const LLNotificationPtr& notification) { return canLogToIM(notification) && canSpawnIMSession(notification); } +// static +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); + if (im_floater != NULL) + { + res = im_floater->getVisible() == TRUE; + } + + return res; +} + // static void LLHandlerUtil::logToIM(const EInstantMessage& session_type, const std::string& session_name, const std::string& from_name, @@ -348,6 +373,42 @@ void LLHandlerUtil::addNotifPanelToIM(const LLNotificationPtr& notification) offer["time"] = LLLogChat::timestamp(true); offer["index"] = (LLSD::Integer)session->mMsgs.size(); session->mMsgs.push_front(offer); +} + +// static +void LLHandlerUtil::updateVisibleIMFLoaterMesages(const LLNotificationPtr& notification) +{ + const std::string name = LLHandlerUtil::getSubstitutionName(notification); + LLUUID from_id = notification->getPayload()["from_id"]; + LLUUID session_id = spawnIMSession(name, from_id); + + LLIMFloater* im_floater = LLIMFloater::findInstance(session_id); + if (im_floater != NULL && im_floater->getVisible()) + { + im_floater->updateMessages(); + } +} + +// static +void LLHandlerUtil::decIMMesageCounter(const LLNotificationPtr& notification) +{ + const std::string name = LLHandlerUtil::getSubstitutionName(notification); + LLUUID from_id = notification->getPayload()["from_id"]; + LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, from_id); + + LLIMModel::LLIMSession * session = LLIMModel::getInstance()->findIMSession( + session_id); + + if (session == NULL) + { + return; + } - LLIMFloater::show(session_id); + LLSD arg; + arg["session_id"] = session_id; + session->mNumUnread--; + arg["num_unread"] = session->mNumUnread; + session->mParticipantUnreadMessageCount--; + arg["participant_unread"] = session->mParticipantUnreadMessageCount; + LLIMModel::getInstance()->mNewMsgSignal(arg); } -- cgit v1.2.3 From 462ab1c7523b1cc0987bc596df4fd3e4b32e5e54 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Fri, 5 Mar 2010 12:37:06 +0200 Subject: =?UTF-8?q?fixed=20EXT-5908=20=E2=80=9CAccepted=20friendship=20not?= =?UTF-8?q?ification=20shouldn't=20spawn=20chiclet=E2=80=9D,=20made=20not?= =?UTF-8?q?=20spawn=20IM=20chiclet=20friendship=20accepted=20notification;?= =?UTF-8?q?=20added=20friendship=20accepted=20notification=20to=20syswell?= =?UTF-8?q?=20chiclet;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/llnotificationhandlerutil.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llnotificationhandlerutil.cpp') diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 565016e63c..11f210be93 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -163,7 +163,6 @@ bool LLHandlerUtil::canLogToNearbyChat(const LLNotificationPtr& notification) bool LLHandlerUtil::canSpawnIMSession(const LLNotificationPtr& notification) { return OFFER_FRIENDSHIP == notification->getName() - || FRIENDSHIP_ACCEPTED == notification->getName() || USER_GIVE_ITEM == notification->getName() || INVENTORY_ACCEPTED == notification->getName() || INVENTORY_DECLINED == notification->getName() -- cgit v1.2.3 From 27283c1de73282590e614b3d5e9bdabe922c0a94 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Fri, 5 Mar 2010 14:13:37 +0200 Subject: =?UTF-8?q?fixed=20EXT-5910=20=E2=80=9COffers=20logging=E2=80=9D,?= =?UTF-8?q?=20made=20logging=20offer=20notifications=20as=20from=20SecondL?= =?UTF-8?q?ife;?= 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 11f210be93..8d1c244a7e 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -279,8 +279,8 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification, bool to_fi } else { - logToIM(IM_NOTHING_SPECIAL, session_name, name, notification->getMessage(), - from_id, from_id); + logToIM(IM_NOTHING_SPECIAL, session_name, "", notification->getMessage(), + from_id, LLUUID()); } } } @@ -348,7 +348,10 @@ std::string LLHandlerUtil::getSubstitutionName(const LLNotificationPtr& notifica if (res.empty()) { LLUUID from_id = notification->getPayload()["FROM_ID"]; - gCacheName->getFullName(from_id, res); + if(!gCacheName->getFullName(from_id, res)) + { + res = ""; + } } return res; } -- cgit v1.2.3 From 2f9cc80c2e0a6ca648871ed74cc10b813d2c4940 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Fri, 5 Mar 2010 17:53:32 +0200 Subject: =?UTF-8?q?fixed=20EXT-5910=20=E2=80=9COffers=20logging=E2=80=9D,?= =?UTF-8?q?=20fixed=20IM=20message=20counter=20when=20received=20interacti?= =?UTF-8?q?ve=20notification(offer);=20corrected=20logging=20to=20file=20o?= =?UTF-8?q?f=20offer=20notification;=20enabled=20logging=20for=20FRIENDSHI?= =?UTF-8?q?P=5FACCEPTED=20notification;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/llnotificationhandlerutil.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/newview/llnotificationhandlerutil.cpp') diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 8d1c244a7e..7b61b200cd 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -139,6 +139,7 @@ bool LLHandlerUtil::canLogToIM(const LLNotificationPtr& notification) || PAYMENT_RECIVED == notification->getName() || OFFER_FRIENDSHIP == notification->getName() || FRIENDSHIP_OFFERED == notification->getName() + || FRIENDSHIP_ACCEPTED == notification->getName() || FRIENDSHIP_ACCEPTED_BYME == notification->getName() || FRIENDSHIP_DECLINED_BYME == notification->getName() || SERVER_OBJECT_MESSAGE == notification->getName() @@ -274,12 +275,12 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification, bool to_fi if(to_file_only) { - logToIM(IM_NOTHING_SPECIAL, session_name, name, notification->getMessage(), - LLUUID(), LLUUID()); + logToIM(IM_NOTHING_SPECIAL, session_name, "", notification->getMessage(), + from_id, LLUUID()); } else { - logToIM(IM_NOTHING_SPECIAL, session_name, "", notification->getMessage(), + logToIM(IM_NOTHING_SPECIAL, session_name, INTERACTIVE_SYSTEM_FROM, notification->getMessage(), from_id, LLUUID()); } } -- cgit v1.2.3 From 7238ce83456b70f64efd15ba522d95ed526f4827 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Tue, 9 Mar 2010 17:55:53 +0200 Subject: Implemented normal sub-task EXT-5950(Do not spawn IM chiclet for "drop on avatar" inventory offers). - Removed check for INVENTORY_ACCEPTED from LLHandlerUtil::canSpawnIMSession(). --HG-- branch : product-engine --- indra/newview/llnotificationhandlerutil.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llnotificationhandlerutil.cpp') diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 7b61b200cd..8fb875ee1f 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -165,7 +165,6 @@ bool LLHandlerUtil::canSpawnIMSession(const LLNotificationPtr& notification) { return OFFER_FRIENDSHIP == notification->getName() || USER_GIVE_ITEM == notification->getName() - || INVENTORY_ACCEPTED == notification->getName() || INVENTORY_DECLINED == notification->getName() || TELEPORT_OFFERED == notification->getName(); } -- cgit v1.2.3 From b2f6cab24f9cf9edf9b33d0f0f59ca4dab1fb209 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Wed, 10 Mar 2010 19:24:56 +0200 Subject: =?UTF-8?q?fixed=20EXT-5910=20=E2=80=9COffers=20logging=E2=80=9D,?= =?UTF-8?q?=20replaced=20interactive=20system=20message=20marker=20with=20?= =?UTF-8?q?correct=20from=20string=20value=20when=20message=20logged=20wit?= =?UTF-8?q?hout=20adding=20to=20the=20session;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/llnotificationhandlerutil.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'indra/newview/llnotificationhandlerutil.cpp') diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 8fb875ee1f..554b67c47d 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -214,7 +214,13 @@ void LLHandlerUtil::logToIM(const EInstantMessage& session_type, session_id); if (session == NULL) { - LLIMModel::instance().logToFile(session_name, from_name, from_id, message); + // replace interactive system message marker with correct from string value + std::string from = from_name; + if (INTERACTIVE_SYSTEM_FROM == from_name) + { + from = SYSTEM_FROM; + } + LLIMModel::instance().logToFile(session_name, from, from_id, message); } else { -- cgit v1.2.3 From 3ab788b14f9cdc3f33a06491d65abc985c045fa4 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Wed, 10 Mar 2010 19:50:24 +0200 Subject: Implemented normal sub-task EXT-5909(Accepted/declined inventory offer shouldn't spawn chiclet). - Removed check for INVENTORY_DECLINED from LLHandlerUtil::canSpawnIMSession(). - Added new method LLHandlerUtil::canSpawnToast() and check with it to LLTipHandler::processNotification() to supress toasts when respective IM window is open. --HG-- branch : product-engine --- indra/newview/llnotificationhandlerutil.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'indra/newview/llnotificationhandlerutil.cpp') diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 554b67c47d..680309167e 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -165,7 +165,6 @@ bool LLHandlerUtil::canSpawnIMSession(const LLNotificationPtr& notification) { return OFFER_FRIENDSHIP == notification->getName() || USER_GIVE_ITEM == notification->getName() - || INVENTORY_DECLINED == notification->getName() || TELEPORT_OFFERED == notification->getName(); } @@ -183,6 +182,15 @@ bool LLHandlerUtil::canSpawnSessionAndLogToIM(const LLNotificationPtr& notificat return canLogToIM(notification) && canSpawnIMSession(notification); } +// static +bool LLHandlerUtil::canSpawnToast(const LLNotificationPtr& notification) +{ + bool cannot_spawn = isIMFloaterOpened(notification) && (INVENTORY_DECLINED == notification->getName() + || INVENTORY_ACCEPTED == notification->getName()); + + return !cannot_spawn; +} + // static bool LLHandlerUtil::isIMFloaterOpened(const LLNotificationPtr& notification) { -- cgit v1.2.3 From ccbbfeb0a0ca268f528ae84b57e55156205ceb41 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Wed, 10 Mar 2010 20:03:28 +0200 Subject: =?UTF-8?q?fixed=20EXT-5904=20=E2=80=9COffers=20embedding=20into?= =?UTF-8?q?=20IM=20windows=E2=80=9D,=20shortened=20timestamp=20of=20embedd?= =?UTF-8?q?ed=20offers;=20unified=20sender=20name=20of=20session=20message?= =?UTF-8?q?=20entry=20and=20file=20log=20entry=20for=20system=20messages;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/llnotificationhandlerutil.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'indra/newview/llnotificationhandlerutil.cpp') diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 554b67c47d..1f08756859 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -208,6 +208,12 @@ void LLHandlerUtil::logToIM(const EInstantMessage& session_type, const std::string& message, const LLUUID& session_owner_id, const LLUUID& from_id) { + std::string from = from_name; + if (from_name.empty()) + { + from = SYSTEM_FROM; + } + LLUUID session_id = LLIMMgr::computeSessionID(session_type, session_owner_id); LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession( @@ -215,7 +221,6 @@ void LLHandlerUtil::logToIM(const EInstantMessage& session_type, if (session == NULL) { // replace interactive system message marker with correct from string value - std::string from = from_name; if (INTERACTIVE_SYSTEM_FROM == from_name) { from = SYSTEM_FROM; @@ -231,7 +236,7 @@ void LLHandlerUtil::logToIM(const EInstantMessage& session_type, // set searched session as active to avoid IM toast popup LLIMModel::instance().setActiveSessionID(session_id); - LLIMModel::instance().addMessage(session_id, from_name, from_id, + LLIMModel::instance().addMessage(session_id, from, from_id, message); // restore active session id @@ -378,7 +383,7 @@ void LLHandlerUtil::addNotifPanelToIM(const LLNotificationPtr& notification) offer["notification_id"] = notification->getID(); offer["from_id"] = notification->getPayload()["from_id"]; offer["from"] = name; - offer["time"] = LLLogChat::timestamp(true); + offer["time"] = LLLogChat::timestamp(false); offer["index"] = (LLSD::Integer)session->mMsgs.size(); session->mMsgs.push_front(offer); } -- cgit v1.2.3 From e7027a57e17b565f98f401f3f2cd1af8c91f2af7 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Thu, 11 Mar 2010 17:53:49 +0200 Subject: =?UTF-8?q?fixed=20EXT-5904=20=E2=80=9COffers=20embedding=20into?= =?UTF-8?q?=20IM=20windows=E2=80=9D,=20revised=20embedding=20and=20logging?= =?UTF-8?q?=20offer=20notification=20to=20provide=20loading=20log=20entry?= =?UTF-8?q?=20in=20case=20notification=20doesn't=20exist;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/llnotificationhandlerutil.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'indra/newview/llnotificationhandlerutil.cpp') diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 741d08af1e..a37e796a6d 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -294,7 +294,7 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification, bool to_fi if(to_file_only) { logToIM(IM_NOTHING_SPECIAL, session_name, "", notification->getMessage(), - from_id, LLUUID()); + LLUUID(), LLUUID()); } else { @@ -389,11 +389,18 @@ void LLHandlerUtil::addNotifPanelToIM(const LLNotificationPtr& notification) LLSD offer; offer["notification_id"] = notification->getID(); - offer["from_id"] = notification->getPayload()["from_id"]; - offer["from"] = name; + offer["from"] = SYSTEM_FROM; offer["time"] = LLLogChat::timestamp(false); offer["index"] = (LLSD::Integer)session->mMsgs.size(); session->mMsgs.push_front(offer); + + + // update IM floater and counters + LLSD arg; + arg["session_id"] = session_id; + arg["num_unread"] = ++(session->mNumUnread); + arg["participant_unread"] = ++(session->mParticipantUnreadMessageCount); + LLIMModel::getInstance()->mNewMsgSignal(arg); } // static -- cgit v1.2.3 From 2fed8d5182813e2077522bb5bbb2cc565b5c283d Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Tue, 16 Mar 2010 14:48:20 +0200 Subject: =?UTF-8?q?fixed=20EXT-5904=20=E2=80=9COffers=20embedding=20into?= =?UTF-8?q?=20IM=20windows=E2=80=9D,=20corrected=20offer=20counter(used=20?= =?UTF-8?q?silent=20adding=20message=20to=20session=20without=20incrementi?= =?UTF-8?q?ng=20counter);=20avoided=20assertion=20when=20received=20offer?= =?UTF-8?q?=20from=20blocked=20avatar=20with=20closed=20IM=20session;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/llnotificationhandlerutil.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llnotificationhandlerutil.cpp') diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index a37e796a6d..cb3d52fe13 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -244,7 +244,7 @@ void LLHandlerUtil::logToIM(const EInstantMessage& session_type, // set searched session as active to avoid IM toast popup LLIMModel::instance().setActiveSessionID(session_id); - LLIMModel::instance().addMessage(session_id, from, from_id, + LLIMModel::instance().addMessageSilently(session_id, from, from_id, message); // restore active session id @@ -367,6 +367,10 @@ std::string LLHandlerUtil::getSubstitutionName(const LLNotificationPtr& notifica if (res.empty()) { LLUUID from_id = notification->getPayload()["FROM_ID"]; + if (from_id.isNull()) + { + from_id = notification->getPayload()["from_id"]; + } if(!gCacheName->getFullName(from_id, res)) { res = ""; -- cgit v1.2.3 From b5ba328480b0d42343fa02219b98c017f3ac0aad Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Tue, 16 Mar 2010 17:50:14 +0200 Subject: =?UTF-8?q?EXT-5904=20=E2=80=9COffers=20embedding=20into=20IM=20wi?= =?UTF-8?q?ndows=E2=80=9D,=20added=20restoring=20IM=20counters=20when=20lo?= =?UTF-8?q?gging=20message;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/llnotificationhandlerutil.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/llnotificationhandlerutil.cpp') diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index cb3d52fe13..ae41e673bf 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -244,8 +244,13 @@ void LLHandlerUtil::logToIM(const EInstantMessage& session_type, // set searched session as active to avoid IM toast popup LLIMModel::instance().setActiveSessionID(session_id); + S32 unread = session->mNumUnread; + S32 participant_unread = session->mParticipantUnreadMessageCount; LLIMModel::instance().addMessageSilently(session_id, from, from_id, message); + // we shouldn't increment counters when logging, so restore them + session->mNumUnread = unread; + session->mParticipantUnreadMessageCount = participant_unread; // restore active session id if (active_session_id.isNull()) -- cgit v1.2.3 From 1c4eeed50fddd32c43fc4093492727035c9da49b Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Fri, 19 Mar 2010 16:35:45 +0200 Subject: fixed EXT-6451 Name of people sending a IM some times is NoBody LLSD::maps keys accross the code are used in mix of cases, lower and upper. Using "from_id" and "FROM_ID" causes avatar id to be null and thus "no body" was displayed. BUT this fix is of no use since several minutes ago viewer-offers feature was merged into release, which overrides avatar name with "Second Life" to display message about teleport offering as system message Reviewed by Q at https://codereview.productengine.com/secondlife/r/72/ --HG-- branch : product-engine --- indra/newview/llnotificationhandlerutil.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llnotificationhandlerutil.cpp') diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index ae41e673bf..5affd5c677 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -372,7 +372,9 @@ std::string LLHandlerUtil::getSubstitutionName(const LLNotificationPtr& notifica if (res.empty()) { LLUUID from_id = notification->getPayload()["FROM_ID"]; - if (from_id.isNull()) + + //*TODO all keys everywhere should be made of the same case, there is a mix of keys in lower and upper cases + if (from_id.isNull()) { from_id = notification->getPayload()["from_id"]; } -- cgit v1.2.3 From 63251d8b31b14b55912d9117f1b508db31e52582 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Fri, 19 Mar 2010 17:17:00 +0200 Subject: =?UTF-8?q?opened=20and=20fixed=20EXT-6478=20=E2=80=9CLoggable=20m?= =?UTF-8?q?essages=20that=20not=20increments=20IM=20counter=20doesn't=20sh?= =?UTF-8?q?ows=20in=20IM=20window=E2=80=9D,=20added=20update=20of=20IM=20f?= =?UTF-8?q?loater=20messages=20on=20logging=20to=20IM=20session;=20reviewe?= =?UTF-8?q?d=20by=20Mike=20Antipov=20at=20https://codereview.productengine?= =?UTF-8?q?.com/secondlife/r/75/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/llnotificationhandlerutil.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'indra/newview/llnotificationhandlerutil.cpp') diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index ae41e673bf..6d4c360f08 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -252,6 +252,9 @@ void LLHandlerUtil::logToIM(const EInstantMessage& session_type, session->mNumUnread = unread; session->mParticipantUnreadMessageCount = participant_unread; + // update IM floater messages + updateIMFLoaterMesages(session_id); + // restore active session id if (active_session_id.isNull()) { @@ -413,12 +416,8 @@ void LLHandlerUtil::addNotifPanelToIM(const LLNotificationPtr& notification) } // static -void LLHandlerUtil::updateVisibleIMFLoaterMesages(const LLNotificationPtr& notification) +void LLHandlerUtil::updateIMFLoaterMesages(const LLUUID& session_id) { - const std::string name = LLHandlerUtil::getSubstitutionName(notification); - LLUUID from_id = notification->getPayload()["from_id"]; - LLUUID session_id = spawnIMSession(name, from_id); - LLIMFloater* im_floater = LLIMFloater::findInstance(session_id); if (im_floater != NULL && im_floater->getVisible()) { @@ -426,6 +425,16 @@ void LLHandlerUtil::updateVisibleIMFLoaterMesages(const LLNotificationPtr& notif } } +// static +void LLHandlerUtil::updateVisibleIMFLoaterMesages(const LLNotificationPtr& notification) +{ + const std::string name = LLHandlerUtil::getSubstitutionName(notification); + LLUUID from_id = notification->getPayload()["from_id"]; + LLUUID session_id = spawnIMSession(name, from_id); + + updateIMFLoaterMesages(session_id); +} + // static void LLHandlerUtil::decIMMesageCounter(const LLNotificationPtr& notification) { -- cgit v1.2.3 From a2150863f97bf4fc49ecc17a2405177abe9d8f73 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Fri, 19 Mar 2010 17:18:53 +0200 Subject: Updated normal task EXT-5905 - Resolving offers. Reusable notifications are deleted when user closes IM floater(old - when user closes Viewer). --HG-- branch : product-engine --- indra/newview/llnotificationhandlerutil.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/newview/llnotificationhandlerutil.cpp') diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 55e0f33121..d3ad61128d 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -176,6 +176,14 @@ bool LLHandlerUtil::canAddNotifPanelToIM(const LLNotificationPtr& notification) || TELEPORT_OFFERED == notification->getName(); } +// static +bool LLHandlerUtil::isNotificationReusable(const LLNotificationPtr& notification) +{ + return OFFER_FRIENDSHIP == notification->getName() + || USER_GIVE_ITEM == notification->getName() + || TELEPORT_OFFERED == notification->getName(); +} + // static bool LLHandlerUtil::canSpawnSessionAndLogToIM(const LLNotificationPtr& notification) { -- cgit v1.2.3