summaryrefslogtreecommitdiff
path: root/indra/newview/llchathistory.cpp
diff options
context:
space:
mode:
authorIgor Borovkov <iborovkov@productengine.com>2010-01-29 18:03:23 +0200
committerIgor Borovkov <iborovkov@productengine.com>2010-01-29 18:03:23 +0200
commit159c788918c410eb384dcfce1555c8a7d01b69c4 (patch)
tree57e103276b5fa35bc274397d332b290ab6a1f42c /indra/newview/llchathistory.cpp
parent81451696f1de85e235818517c01b8d255d1bb661 (diff)
parent86609394caf1ebb20dd90de37b9af1471ae8aa20 (diff)
merge
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llchathistory.cpp')
-rw-r--r--indra/newview/llchathistory.cpp35
1 files changed, 33 insertions, 2 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index 8cfcca31ce..a570862675 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