From 8c3d3d4b07f12e3462af7745016536389ab7cf73 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Wed, 16 Jan 2013 16:40:59 +0200 Subject: CHUI-618 ADD FIX User sees no indication of offline messages received with conversation log preference turned off: forced flashing of conversation's item when offline message is present --- indra/newview/llimview.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index ff171fc0f8..d0a8dfc0c8 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -2620,8 +2620,9 @@ void LLIMMgr::addMessage( if (is_offline_msg) { LLFloaterReg::showInstance("im_container"); + LLFloaterReg::getTypedInstance("im_container")-> + flashConversationItemWidget(session_id, true); } - } void LLIMMgr::addSystemMessage(const LLUUID& session_id, const std::string& message_name, const LLSD& args) -- cgit v1.2.3 From 5083517c7cd6b91b8920ab0f698600abed955280 Mon Sep 17 00:00:00 2001 From: Cho Date: Thu, 17 Jan 2013 01:57:19 +0000 Subject: CHUI-292 FIX Extra space in object chiclet toasts in CHUI viewer compared with release viewer In LLToastNotifyPanel, moved mInfoPanel->SetFollowsAll() immediately before call to snapToMessageHeight() as was previously the case in release viewer --- indra/newview/lltoastnotifypanel.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index d494d12903..268b68b539 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -356,9 +356,8 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images ) if(rect != LLRect::null) { this->setShape(rect); - } + } mInfoPanel = getChild("info_panel"); - mInfoPanel->setFollowsAll(); mControlPanel = getChild("control_panel"); BUTTON_WIDTH = gSavedSettings.getS32("ToastButtonWidth"); @@ -453,10 +452,10 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images ) if(h_pad < 2*HPAD) { /* - * Probably it is a scriptdialog toast - * for a scriptdialog toast h_pad can be < 2*HPAD if we have a lot of buttons. - * In last case set default h_pad to avoid heaping of buttons - */ + * Probably it is a scriptdialog toast + * for a scriptdialog toast h_pad can be < 2*HPAD if we have a lot of buttons. + * In last case set default h_pad to avoid heaping of buttons + */ S32 button_per_row = button_panel_width / BUTTON_WIDTH; h_pad = (button_panel_width % BUTTON_WIDTH) / (button_per_row - 1);// -1 because we do not need space after last button in a row if(h_pad < 2*HPAD) // still not enough space between buttons ? @@ -491,10 +490,10 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images ) //mButtons.assign(buttons.begin(), buttons.end()); } } + // adjust panel's height to the text size + mInfoPanel->setFollowsAll(); snapToMessageHeight(mTextBox, MAX_LENGTH); - - } -- cgit v1.2.3 From fdf774f51fd24bb62d1e1fc580bd04df4547b9f8 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 17 Jan 2013 13:52:51 -0800 Subject: CHUI-685 Problem: The notifications .xml file was cleared upon exit because removeIMNotification was being called and deleting inventory offers becaus they did not have a session id. Resolution: Now check to make sure that removeIMNotification only removes IMs (IMToast). --- .../newview/lldonotdisturbnotificationstorage.cpp | 62 ++++++++++++---------- indra/newview/lldonotdisturbnotificationstorage.h | 3 -- indra/newview/llfloaterimcontainer.cpp | 16 +++--- 3 files changed, 40 insertions(+), 41 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lldonotdisturbnotificationstorage.cpp b/indra/newview/lldonotdisturbnotificationstorage.cpp index 42b455c1ce..5bea7d41f6 100644 --- a/indra/newview/lldonotdisturbnotificationstorage.cpp +++ b/indra/newview/lldonotdisturbnotificationstorage.cpp @@ -43,15 +43,16 @@ #include "lluuid.h" static const F32 DND_TIMER = 3.0; +const std::string toastName = "IMToast"; LLDoNotDisturbNotificationStorageTimer::LLDoNotDisturbNotificationStorageTimer() : LLEventTimer(DND_TIMER) { - mEventTimer.start(); + //mEventTimer.start(); } LLDoNotDisturbNotificationStorageTimer::~LLDoNotDisturbNotificationStorageTimer() { - mEventTimer.stop(); + //mEventTimer.stop(); } BOOL LLDoNotDisturbNotificationStorageTimer::tick() @@ -152,27 +153,27 @@ void LLDoNotDisturbNotificationStorage::loadNotifications() std::string notificationName = notification_params["name"]; LLNotificationPtr notification = instance.find(notificationID); - if(notificationName == "IMToast") + if(notificationName == toastName) { imToastExists = true; } //New notification needs to be added - notification = (LLNotificationPtr) new LLNotification(notification_params.with("is_dnd", true)); - LLNotificationResponderInterface* responder = createResponder(notification_params["responder_sd"]["responder_type"], notification_params["responder_sd"]); - if (responder == NULL) - { - LL_WARNS("LLDoNotDisturbNotificationStorage") << "cannot create responder for notification of type '" - << notification->getType() << "'" << LL_ENDL; - } - else - { - LLNotificationResponderPtr responderPtr(responder); - notification->setResponseFunctor(responderPtr); - } - - instance.add(notification); + notification = (LLNotificationPtr) new LLNotification(notification_params.with("is_dnd", true)); + LLNotificationResponderInterface* responder = createResponder(notification_params["responder_sd"]["responder_type"], notification_params["responder_sd"]); + if (responder == NULL) + { + LL_WARNS("LLDoNotDisturbNotificationStorage") << "cannot create responder for notification of type '" + << notification->getType() << "'" << LL_ENDL; + } + else + { + LLNotificationResponderPtr responderPtr(responder); + notification->setResponseFunctor(responderPtr); } + + instance.add(notification); + } if(imToastExists) { @@ -200,7 +201,7 @@ void LLDoNotDisturbNotificationStorage::updateNotifications() LLNotificationPtr notification = it->second; std::string notificationName = notification->getName(); - if(notificationName == "IMToast") + if(notificationName == toastName) { imToastExists = true; } @@ -221,9 +222,9 @@ void LLDoNotDisturbNotificationStorage::updateNotifications() //When exit DND mode, write empty notifications file if(commChannel->getHistorySize()) { - commChannel->clearHistory(); - saveNotifications(); -} + commChannel->clearHistory(); + saveNotifications(); + } } LLNotificationChannelPtr LLDoNotDisturbNotificationStorage::getCommunicationChannel() const @@ -241,6 +242,7 @@ void LLDoNotDisturbNotificationStorage::removeIMNotification(const LLUUID& sessi LLNotificationPtr notification; LLSD substitutions; LLUUID notificationSessionID; + std::string notificationName; LLCommunicationChannel::history_list_t::iterator it; std::vector itemsToRemove; @@ -252,8 +254,10 @@ void LLDoNotDisturbNotificationStorage::removeIMNotification(const LLUUID& sessi notification = it->second; substitutions = notification->getSubstitutions(); notificationSessionID = substitutions["SESSION_ID"].asUUID(); + notificationName = notification->getName(); - if(session_id == notificationSessionID) + if(notificationName == toastName + && session_id == notificationSessionID) { itemsToRemove.push_back(it); } @@ -263,14 +267,14 @@ void LLDoNotDisturbNotificationStorage::removeIMNotification(const LLUUID& sessi //Remove the notifications if(itemsToRemove.size()) { - while(itemsToRemove.size()) - { - it = itemsToRemove.back(); - notification = it->second; + while(itemsToRemove.size()) + { + it = itemsToRemove.back(); + notification = it->second; commChannel->removeItemFromHistory(notification); - instance.cancel(notification); - itemsToRemove.pop_back(); - } + instance.cancel(notification); + itemsToRemove.pop_back(); + } //Trigger saving of notifications to xml once all have been removed saveNotifications(); } diff --git a/indra/newview/lldonotdisturbnotificationstorage.h b/indra/newview/lldonotdisturbnotificationstorage.h index fd03b71357..fd7cc7ee82 100644 --- a/indra/newview/lldonotdisturbnotificationstorage.h +++ b/indra/newview/lldonotdisturbnotificationstorage.h @@ -42,9 +42,6 @@ public: ~LLDoNotDisturbNotificationStorageTimer(); public: - void startTimer(); - void stopTimer(); - bool isRunning(); BOOL tick(); }; diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index cc23449449..8f290ae7c1 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -1299,11 +1299,14 @@ BOOL LLFloaterIMContainer::selectConversationPair(const LLUUID& session_id, bool if (widget && widget->getParentFolder()) { widget->getParentFolder()->setSelection(widget, FALSE, FALSE); - if(gAgent.isDoNotDisturb()) - { - LLDoNotDisturbNotificationStorage::getInstance()->removeIMNotification(session_id); - } } + + //When in DND mode, remove stored IM notifications + //Nearby chat (Null) IMs are not stored while in DND mode, so can ignore removal + if(gAgent.isDoNotDisturb() && session_id.notNull()) + { + LLDoNotDisturbNotificationStorage::getInstance()->removeIMNotification(session_id); + } } /* floater processing */ @@ -1324,11 +1327,6 @@ BOOL LLFloaterIMContainer::selectConversationPair(const LLUUID& session_id, bool // Switch to the conversation floater that is being selected selectFloater(session_floater); } - - if(gAgent.isDoNotDisturb()) - { - LLDoNotDisturbNotificationStorage::getInstance()->removeIMNotification(session_id); - } } // Set the focus on the selected floater -- cgit v1.2.3 From 68adda3627b0583e01796b229e1c1f920f28ff37 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 17 Jan 2013 14:12:48 -0800 Subject: CHUI-685 removing some commented out code --- indra/newview/lldonotdisturbnotificationstorage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lldonotdisturbnotificationstorage.cpp b/indra/newview/lldonotdisturbnotificationstorage.cpp index 5bea7d41f6..824ff67972 100644 --- a/indra/newview/lldonotdisturbnotificationstorage.cpp +++ b/indra/newview/lldonotdisturbnotificationstorage.cpp @@ -47,12 +47,12 @@ const std::string toastName = "IMToast"; LLDoNotDisturbNotificationStorageTimer::LLDoNotDisturbNotificationStorageTimer() : LLEventTimer(DND_TIMER) { - //mEventTimer.start(); + } LLDoNotDisturbNotificationStorageTimer::~LLDoNotDisturbNotificationStorageTimer() { - //mEventTimer.stop(); + } BOOL LLDoNotDisturbNotificationStorageTimer::tick() -- cgit v1.2.3 From 6c79873d8dcb08c891ecd04f5706e69fe3a75b7d Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 17 Jan 2013 15:14:02 -0800 Subject: CHUI-680: Adjusted LLResponderRegistry to be derived from LLRegistrySingleton instead of LLResponderRegistry making its over version. --- indra/newview/llnotificationstorage.cpp | 93 ++++++++++++--------------------- 1 file changed, 33 insertions(+), 60 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llnotificationstorage.cpp b/indra/newview/llnotificationstorage.cpp index 4c5b7cc198..b6184f09bf 100644 --- a/indra/newview/llnotificationstorage.cpp +++ b/indra/newview/llnotificationstorage.cpp @@ -38,30 +38,43 @@ #include "llsd.h" #include "llsdserialize.h" #include "llsingleton.h" -#include "llviewermessage.h" +#include "llregistry.h" +#include "llviewermessage.h" +typedef boost::function responder_constructor_t; -class LLResponderRegistry : public LLSingleton +class LLResponderRegistry : public LLRegistrySingleton { -public: - LLResponderRegistry(); - ~LLResponderRegistry(); - - LLNotificationResponderInterface* createResponder(const std::string& pNotificationName, const LLSD& pParams); - -protected: - -private: - template static LLNotificationResponderInterface* create(const LLSD& pParams); - - typedef boost::function responder_constructor_t; - - void add(const std::string& pNotificationName, const responder_constructor_t& pConstructor); - - typedef std::map build_map_t; - build_map_t mBuildMap; + public: + template static LLNotificationResponderInterface * create(const LLSD& pParams); + LLNotificationResponderInterface * createResponder(const std::string& pNotificationName, const LLSD& pParams); }; +template LLNotificationResponderInterface * LLResponderRegistry::create(const LLSD& pParams) +{ + RESPONDER_TYPE* responder = new RESPONDER_TYPE(); + responder->fromLLSD(pParams); + return responder; +} + + +LLNotificationResponderInterface * LLResponderRegistry::createResponder(const std::string& pNotificationName, const LLSD& pParams) +{ + responder_constructor_t * factoryFunc = (LLResponderRegistry::getValue(pNotificationName)); + + if(factoryFunc) + { + return (*factoryFunc)(pParams); + } + + return NULL; +} + +LLResponderRegistry::StaticRegistrar sRegisterObjectGiveItem("ObjectGiveItem", &LLResponderRegistry::create); +LLResponderRegistry::StaticRegistrar sRegisterUserGiveItem("UserGiveItem", &LLResponderRegistry::create); +LLResponderRegistry::StaticRegistrar sRegisterOfferInfo("offer_info", &LLResponderRegistry::create); + + LLNotificationStorage::LLNotificationStorage(std::string pFileName) : mFileName(pFileName) { @@ -116,47 +129,7 @@ bool LLNotificationStorage::readNotifications(LLSD& pNotificationData) const return didFileRead; } -LLNotificationResponderInterface* LLNotificationStorage::createResponder(const std::string& pNotificationName, const LLSD& pParams) const +LLNotificationResponderInterface * LLNotificationStorage::createResponder(const std::string& pNotificationName, const LLSD& pParams) const { return LLResponderRegistry::getInstance()->createResponder(pNotificationName, pParams); } - -LLResponderRegistry::LLResponderRegistry() - : LLSingleton() - , mBuildMap() -{ - add("ObjectGiveItem", &create); - add("UserGiveItem", &create); - add("offer_info", &create); -} - -LLResponderRegistry::~LLResponderRegistry() -{ -} - -LLNotificationResponderInterface* LLResponderRegistry::createResponder(const std::string& pNotificationName, const LLSD& pParams) -{ - build_map_t::const_iterator it = mBuildMap.find(pNotificationName); - if(mBuildMap.end() == it) - { - return NULL; - } - responder_constructor_t ctr = it->second; - return ctr(pParams); -} - -template LLNotificationResponderInterface* LLResponderRegistry::create(const LLSD& pParams) -{ - RESPONDER_TYPE* responder = new RESPONDER_TYPE(); - responder->fromLLSD(pParams); - return responder; -} - -void LLResponderRegistry::add(const std::string& pNotificationName, const responder_constructor_t& pConstructor) -{ - if (mBuildMap.find(pNotificationName) != mBuildMap.end()) - { - LL_ERRS("LLResponderRegistry") << "Responder is already registered : " << pNotificationName << LL_ENDL; - } - mBuildMap.insert(std::make_pair(pNotificationName, pConstructor)); -} -- cgit v1.2.3 From d0235ad1789d05524065307f4514a76d55f4e847 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 17 Jan 2013 16:06:08 -0800 Subject: CHUI-604: Problem: DND response was inside of the responder for the inventory offer. Resolution: DND response is now sent upon receiving an offer notification from an agent. --- indra/newview/llviewermessage.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index db81e057de..9878f9bc81 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1618,12 +1618,6 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& { opener = discard_agent_offer; } - - - if (gAgent.isDoNotDisturb() && (!mFromGroup && !mFromObject)) - { - send_do_not_disturb_message(gMessageSystem, mFromID); - } if (modified_form != NULL) { @@ -1991,6 +1985,11 @@ void inventory_offer_handler(LLOfferInfo* info) // In viewer 2 we're now auto receiving inventory offers and messaging as such (not sending reject messages). info->send_auto_receive_response(); + if (gAgent.isDoNotDisturb()) + { + send_do_not_disturb_message(gMessageSystem, info->mFromID); + } + // Inform user that there is a script floater via toast system { payload["give_inventory_notification"] = TRUE; -- cgit v1.2.3