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/llimfloater.cpp | 23 ++++++++++++++++------- indra/newview/llnotificationhandlerutil.cpp | 13 ++++++++++--- indra/newview/llnotificationofferhandler.cpp | 9 ++------- 3 files changed, 28 insertions(+), 17 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 5f56690d2e..9b5c69d33d 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -648,14 +648,23 @@ void LLIMFloater::updateMessages() if (msg.has("notification_id")) { chat.mNotifId = msg["notification_id"].asUUID(); - // remove embedded notification from channel - LLNotificationsUI::LLScreenChannel* channel = dynamic_cast - (LLNotificationsUI::LLChannelManager::getInstance()-> - findChannelByID(LLUUID(gSavedSettings.getString("NotificationChannelUUID")))); - if (getVisible()) + // if notification exists - embed it + if (LLNotificationsUtil::find(chat.mNotifId) != NULL) { - // toast will be automatically closed since it is not storable toast - channel->hideToast(chat.mNotifId); + // remove embedded notification from channel + LLNotificationsUI::LLScreenChannel* channel = dynamic_cast + (LLNotificationsUI::LLChannelManager::getInstance()-> + findChannelByID(LLUUID(gSavedSettings.getString("NotificationChannelUUID")))); + if (getVisible()) + { + // toast will be automatically closed since it is not storable toast + channel->hideToast(chat.mNotifId); + } + } + // if notification doesn't exist - try to use next message which should be log entry + else + { + continue; } } //process text message 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 diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp index 97a1df66df..0a42d8adbe 100644 --- a/indra/newview/llnotificationofferhandler.cpp +++ b/indra/newview/llnotificationofferhandler.cpp @@ -156,7 +156,8 @@ bool LLOfferHandler::processNotification(const LLSD& notify) if (LLHandlerUtil::canLogToIM(notification)) { - if (LLHandlerUtil::isIMFloaterOpened(notification)) + // log only to file if notif panel can be embedded to IM and IM is opened + if (add_notid_to_im && LLHandlerUtil::isIMFloaterOpened(notification)) { LLHandlerUtil::logToIMP2P(notification, true); } @@ -165,12 +166,6 @@ bool LLOfferHandler::processNotification(const LLSD& notify) LLHandlerUtil::logToIMP2P(notification); } } - - // update IM floater messages if need - if (add_notid_to_im) - { - LLHandlerUtil::updateVisibleIMFLoaterMesages(notification); - } } } else if (notify["sigtype"].asString() == "delete") -- cgit v1.2.3