diff options
author | Dmitry Zaporozhan <dzaporozhan@productengine.com> | 2010-03-19 15:30:02 +0200 |
---|---|---|
committer | Dmitry Zaporozhan <dzaporozhan@productengine.com> | 2010-03-19 15:30:02 +0200 |
commit | 97a35b487545572ce9409e06bd54ad29f0da7114 (patch) | |
tree | 9e4968f4feb058196534c04eb5091efa18f1219c /indra/newview/llimfloater.cpp | |
parent | 141f2aa9ee5f71134c1ac13815b7e54092ee4756 (diff) | |
parent | 978bf16797921d60351c09d9fc45721cceceb6e9 (diff) |
Merged with viewer-offers
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llimfloater.cpp')
-rw-r--r-- | indra/newview/llimfloater.cpp | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 77eaebb0bc..f0e195c37a 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -454,7 +454,7 @@ void LLIMFloater::getAllowedRect(LLRect& rect) void LLIMFloater::setDocked(bool docked, bool pop_on_undock) { // update notification channel state - LLNotificationsUI::LLScreenChannel* channel = dynamic_cast<LLNotificationsUI::LLScreenChannel*> + LLNotificationsUI::LLScreenChannel* channel = static_cast<LLNotificationsUI::LLScreenChannel*> (LLNotificationsUI::LLChannelManager::getInstance()-> findChannelByID(LLUUID(gSavedSettings.getString("NotificationChannelUUID")))); @@ -473,7 +473,7 @@ void LLIMFloater::setDocked(bool docked, bool pop_on_undock) void LLIMFloater::setVisible(BOOL visible) { - LLNotificationsUI::LLScreenChannel* channel = dynamic_cast<LLNotificationsUI::LLScreenChannel*> + LLNotificationsUI::LLScreenChannel* channel = static_cast<LLNotificationsUI::LLScreenChannel*> (LLNotificationsUI::LLChannelManager::getInstance()-> findChannelByID(LLUUID(gSavedSettings.getString("NotificationChannelUUID")))); LLTransientDockableFloater::setVisible(visible); @@ -642,6 +642,24 @@ void LLIMFloater::updateMessages() if (msg.has("notification_id")) { chat.mNotifId = msg["notification_id"].asUUID(); + // if notification exists - embed it + if (LLNotificationsUtil::find(chat.mNotifId) != NULL) + { + // remove embedded notification from channel + LLNotificationsUI::LLScreenChannel* channel = static_cast<LLNotificationsUI::LLScreenChannel*> + (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 else @@ -651,6 +669,19 @@ void LLIMFloater::updateMessages() mChatHistory->appendMessage(chat, chat_args); mLastMessageIndex = msg["index"].asInteger(); + + // if it is a notification - next message is a notification history log, so skip it + if (chat.mNotifId.notNull() && LLNotificationsUtil::find(chat.mNotifId) != NULL) + { + if (++iter == iter_end) + { + break; + } + else + { + mLastMessageIndex++; + } + } } } } |