diff options
| author | Alexei Arabadji <aarabadji@productengine.com> | 2010-01-29 17:48:10 +0200 |
|---|---|---|
| committer | Alexei Arabadji <aarabadji@productengine.com> | 2010-01-29 17:48:10 +0200 |
| commit | 86609394caf1ebb20dd90de37b9af1471ae8aa20 (patch) | |
| tree | a0b437938326c7038e82f8b140c113f484b554cb /indra/newview/llchathistory.cpp | |
| parent | 0524e91aae36d87d8e0944fd294e02f145d5d547 (diff) | |
fixed major EXT-3643 “Embed friendship offer into IM window”;
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llchathistory.cpp')
| -rw-r--r-- | indra/newview/llchathistory.cpp | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index f1e7e622b3..acbd0db868 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -51,9 +51,12 @@ #include "llslurl.h" #include "lllayoutstack.h" #include "llagent.h" +#include "llnotificationsutil.h" +#include "lltoastnotifypanel.h" #include "llviewerregion.h" #include "llworld.h" + #include "llsidetray.h"//for blocked objects panel static LLDefaultChildRegistry::Register<LLChatHistory> r("chat_history"); @@ -654,8 +657,36 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL mLastMessageTimeStr = chat.mTimeStr; } - std::string message = irc_me ? chat.mText.substr(3) : chat.mText; - mEditor->appendText(message, FALSE, style_params); + if (chat.mNotifId.notNull()) + { + LLNotificationPtr notification = LLNotificationsUtil::find(chat.mNotifId); + if (notification != NULL) + { + LLToastNotifyPanel* notify_box = new LLToastNotifyPanel( + notification); + notify_box->setFollowsLeft(); + notify_box->setFollowsRight(); + //Prepare the rect for the view + LLRect target_rect = mEditor->getDocumentView()->getRect(); + // squeeze down the widget by subtracting padding off left and right + target_rect.mLeft += mLeftWidgetPad + mEditor->getHPad(); + target_rect.mRight -= mRightWidgetPad; + notify_box->reshape(target_rect.getWidth(), + notify_box->getRect().getHeight()); + notify_box->setOrigin(target_rect.mLeft, notify_box->getRect().mBottom); + + LLInlineViewSegment::Params params; + params.view = notify_box; + params.left_pad = mLeftWidgetPad; + params.right_pad = mRightWidgetPad; + mEditor->appendWidget(params, "\n", false); + } + } + else + { + std::string message = irc_me ? chat.mText.substr(3) : chat.mText; + mEditor->appendText(message, FALSE, style_params); + } mEditor->blockUndo(); // automatically scroll to end when receiving chat from myself |
