summaryrefslogtreecommitdiff
path: root/indra/newview/llchiclet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llchiclet.cpp')
-rw-r--r--indra/newview/llchiclet.cpp48
1 files changed, 23 insertions, 25 deletions
diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp
index a661808d1f..64d8a68a99 100644
--- a/indra/newview/llchiclet.cpp
+++ b/indra/newview/llchiclet.cpp
@@ -33,7 +33,8 @@
#include "lleventtimer.h"
#include "llgroupactions.h"
#include "lliconctrl.h"
-#include "llimfloater.h"
+#include "llfloaterimsession.h"
+#include "llfloaterimcontainer.h"
#include "llimview.h"
#include "llfloaterreg.h"
#include "lllocalcliprect.h"
@@ -335,30 +336,15 @@ void LLIMWellChiclet::messageCountChanged(const LLSD& session_data)
/* LLNotificationChiclet implementation */
/************************************************************************/
LLNotificationChiclet::LLNotificationChiclet(const Params& p)
-: LLSysWellChiclet(p)
-, mUreadSystemNotifications(0)
+: LLSysWellChiclet(p),
+ mUreadSystemNotifications(0)
{
- // connect counter handlers to the signals
- connectCounterUpdatersToSignal("notify");
- connectCounterUpdatersToSignal("groupnotify");
- connectCounterUpdatersToSignal("offer");
-
+ mNotificationChannel.reset(new ChicletNotificationChannel(this));
// ensure that notification well window exists, to synchronously
// handle toast add/delete events.
LLNotificationWellWindow::getInstance()->setSysWellChiclet(this);
}
-void LLNotificationChiclet::connectCounterUpdatersToSignal(const std::string& notification_type)
-{
- LLNotificationsUI::LLNotificationManager* manager = LLNotificationsUI::LLNotificationManager::getInstance();
- LLNotificationsUI::LLEventHandler* n_handler = manager->getHandlerForNotification(notification_type);
- if(n_handler)
- {
- n_handler->setNewNotificationCallback(boost::bind(&LLNotificationChiclet::incUreadSystemNotifications, this));
- n_handler->setDelNotification(boost::bind(&LLNotificationChiclet::decUreadSystemNotifications, this));
- }
-}
-
void LLNotificationChiclet::onMenuItemClicked(const LLSD& user_data)
{
std::string action = user_data.asString();
@@ -407,6 +393,18 @@ void LLNotificationChiclet::setCounter(S32 counter)
updateWidget(getCounter() == 0);
}
+
+bool LLNotificationChiclet::ChicletNotificationChannel::filterNotification( LLNotificationPtr notification )
+{
+ if( !(notification->canLogToIM() && notification->hasFormElements())
+ && (!notification->getPayload().has("give_inventory_notification")
+ || notification->getPayload()["give_inventory_notification"]))
+ {
+ return true;
+ }
+ return false;
+}
+
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
@@ -607,7 +605,7 @@ bool LLIMChiclet::getShowNewMessagesIcon()
void LLIMChiclet::onMouseDown()
{
- LLIMFloater::toggle(getSessionId());
+ LLFloaterIMSession::toggle(getSessionId());
setCounter(0);
}
@@ -756,7 +754,7 @@ void LLIMP2PChiclet::updateMenuItems()
if(getSessionId().isNull())
return;
- LLIMFloater* open_im_floater = LLIMFloater::findInstance(getSessionId());
+ LLFloaterIMSession* open_im_floater = LLFloaterIMSession::findInstance(getSessionId());
bool open_window_exists = open_im_floater && open_im_floater->getVisible();
mPopupMenu->getChild<LLUICtrl>("Send IM")->setEnabled(!open_window_exists);
@@ -1032,7 +1030,7 @@ void LLIMGroupChiclet::updateMenuItems()
if(getSessionId().isNull())
return;
- LLIMFloater* open_im_floater = LLIMFloater::findInstance(getSessionId());
+ LLFloaterIMSession* open_im_floater = LLFloaterIMSession::findInstance(getSessionId());
bool open_window_exists = open_im_floater && open_im_floater->getVisible();
mPopupMenu->getChild<LLUICtrl>("Chat")->setEnabled(!open_window_exists);
}
@@ -1118,7 +1116,7 @@ void LLChicletPanel::onMessageCountChanged(const LLSD& data)
LLUUID session_id = data["session_id"].asUUID();
S32 unread = data["participant_unread"].asInteger();
- LLIMFloater* im_floater = LLIMFloater::findInstance(session_id);
+ LLFloaterIMSession* im_floater = LLFloaterIMSession::findInstance(session_id);
if (im_floater && im_floater->getVisible() && im_floater->hasFocus())
{
unread = 0;
@@ -1199,7 +1197,7 @@ void LLChicletPanel::onCurrentVoiceChannelChanged(const LLUUID& session_id)
chiclet->setShowSpeaker(true);
if (gSavedSettings.getBOOL("OpenIMOnVoice"))
{
- LLIMFloater::show(chiclet->getSessionId());
+ LLFloaterIMContainer::getInstance()->showConversation(session_id);
}
}
}
@@ -1690,7 +1688,7 @@ bool LLChicletPanel::isAnyIMFloaterDoked()
for (chiclet_list_t::iterator it = mChicletList.begin(); it
!= mChicletList.end(); it++)
{
- LLIMFloater* im_floater = LLFloaterReg::findTypedInstance<LLIMFloater>(
+ LLFloaterIMSession* im_floater = LLFloaterReg::findTypedInstance<LLFloaterIMSession>(
"impanel", (*it)->getSessionId());
if (im_floater != NULL && im_floater->getVisible()
&& !im_floater->isMinimized() && im_floater->isDocked())