From ab5e6c93c927935943b7135a8e70dd50256e3c2e Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Tue, 1 Dec 2009 15:16:12 +0200 Subject: =?UTF-8?q?implemented=20EXT-2799=20=E2=80=9CRecord=20to=20IM=20hi?= =?UTF-8?q?story=20notification=20about=20L$=20payments=20by=20other=20ava?= =?UTF-8?q?tar=E2=80=9D;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/llviewermessage.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 9fc818e1ff..a5e06e7cff 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4347,7 +4347,28 @@ void process_money_balance_reply( LLMessageSystem* msg, void** ) // *TODO: Translate LLSD args; args["MESSAGE"] = desc; - LLNotificationsUtil::add("SystemMessage", args); + + // this is a marker to retrieve avatar name from server message: + // " paid you L$" + const std::string marker = "paid you L$"; + + // extract avatar name from system message + std::string name = desc.substr(0, desc.find(marker, 0)); + LLStringUtil::trim(name); + + // if name extracted and name cache contains avatar id send loggable notification + LLUUID from_id; + if(name.size() > 0 && gCacheName->getUUID(name, from_id)) + { + args["NAME"] = name; + LLSD payload; + payload["from_id"] = from_id; + LLNotificationsUtil::add("PaymentRecived", args, payload); + } + else + { + LLNotificationsUtil::add("SystemMessage", args); + } // Once the 'recent' container gets large enough, chop some // off the beginning. -- cgit v1.2.3 From 07f284408bbf9b7377860ddb9c3864d5a32e0b3e Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Tue, 1 Dec 2009 21:46:19 +0200 Subject: Implemented normal task EXT-2476 (llGiveInventory() should be handled also by Chiclet subsystem along with Notificaton subsystem) --HG-- branch : product-engine --- indra/newview/llviewermessage.cpp | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index a5e06e7cff..23d02af73d 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1240,6 +1240,10 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& gInventory.addObserver(opener); } + // Remove script dialog because there is no need in it no more. + LLUUID object_id = notification["payload"]["object_id"].asUUID(); + LLScriptFloaterManager::instance().removeNotificationByObjectId(object_id); + delete this; return false; } @@ -1414,7 +1418,11 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const { gInventory.addObserver(opener); } - + + // Remove script dialog because there is no need in it no more. + LLUUID object_id = notification["payload"]["object_id"].asUUID(); + LLScriptFloaterManager::instance().removeNotificationByObjectId(object_id); + delete this; return false; } @@ -1502,7 +1510,18 @@ void inventory_offer_handler(LLOfferInfo* info) } } + // If mObjectID is null then generate the object_id based on msg to prevent + // multiple creation of chiclets for same object. + LLUUID object_id = info->mObjectID; + if (object_id.isNull()) + object_id.generate(msg); + payload["from_id"] = info->mFromID; + // Needed by LLScriptFloaterManager to bind original notification with + // faked for toast one. + payload["object_id"] = object_id; + // Flag indicating that this notification is faked for toast. + payload["give_inventory_notification"] = FALSE; args["OBJECTFROMNAME"] = info->mFromName; args["NAME"] = info->mFromName; args["NAME_SLURL"] = LLSLURL::buildCommand("agent", info->mFromID, "about"); @@ -1543,9 +1562,16 @@ 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(); } - + // Pop up inv offer notification and let the user accept (keep), or reject (and silently delete) the inventory. - LLNotifications::instance().add(p); + LLNotifications::instance().add(p); + + // Inform user that there is a script floater via toast system + { + payload["give_inventory_notification"] = TRUE; + LLNotificationPtr notification = LLNotifications::instance().add(p.payload(payload)); + LLScriptFloaterManager::getInstance()->setNotificationToastId(object_id, notification->getID()); + } } bool lure_callback(const LLSD& notification, const LLSD& response) -- cgit v1.2.3 From 8fdd2e0b28121ead88da55c2be760a5f62b6d112 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 1 Dec 2009 21:12:34 -0500 Subject: EXT-3028 : "Find Original" does nothing if floater inventory isn't open Changed logic for getActiveInventory so that it considers InventorySP. Removed getActiveInventory and replaced with getActiveInventoryPanel since that follows its current usage. This currently contains a bug because the InventorySP always thinks it's open. --HG-- branch : avatar-pipeline --- indra/newview/llviewermessage.cpp | 72 +++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 41 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 9fc818e1ff..549be65c2d 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -31,9 +31,10 @@ */ #include "llviewerprecompiledheaders.h" - #include "llviewermessage.h" +// TODO: Remove unnecessary headers. + #include #include "llaudioengine.h" @@ -91,7 +92,6 @@ #include "llinventorymodel.h" #include "llinventoryobserver.h" #include "llinventorypanel.h" -#include "llfloaterinventory.h" #include "llmenugl.h" #include "llmoveview.h" #include "llmutelist.h" @@ -933,56 +933,46 @@ void open_inventory_offer(const std::vector& items, const std::string& f //highlight item, if it's not in the trash or lost+found // Don't auto-open the inventory floater - LLFloaterInventory* view = NULL; if(gSavedSettings.getBOOL("ShowInInventory") && asset_type != LLAssetType::AT_CALLINGCARD && item->getInventoryType() != LLInventoryType::IT_ATTACHMENT && !from_name.empty()) { - view = LLFloaterInventory::showAgentInventory(); //TODO:this should be moved to the end of method after all the checks, //but first decide what to do with active inventory if any (EK) LLSD key; key["select"] = item->getUUID(); LLSideTray::getInstance()->showPanel("sidepanel_inventory", key); } - else - { - view = LLFloaterInventory::getActiveInventory(); - } - if(!view) + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(); + if(active_panel) { - return; - } - - //Trash Check - const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); - if(gInventory.isObjectDescendentOf(item->getUUID(), trash_id)) - { - return; - } - const LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); - //BOOL inventory_has_focus = gFocusMgr.childHasKeyboardFocus(view); - BOOL user_is_away = gAwayTimer.getStarted(); + //Trash Check + const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); + if(gInventory.isObjectDescendentOf(item->getUUID(), trash_id)) + { + return; + } + const LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); + //BOOL inventory_has_focus = gFocusMgr.childHasKeyboardFocus(view); + BOOL user_is_away = gAwayTimer.getStarted(); - // don't select lost and found items if the user is active - if (gInventory.isObjectDescendentOf(item->getUUID(), lost_and_found_id) - && !user_is_away) - { - return; - } + // don't select lost and found items if the user is active + if (gInventory.isObjectDescendentOf(item->getUUID(), lost_and_found_id) + && !user_is_away) + { + return; + } - //Not sure about this check. Could make it easy to miss incoming items. - //don't dick with highlight while the user is working - //if(inventory_has_focus && !user_is_away) - // break; - LL_DEBUGS("Messaging") << "Highlighting" << item->getUUID() << LL_ENDL; - //highlight item + //Not sure about this check. Could make it easy to miss incoming items. + //don't dick with highlight while the user is working + //if(inventory_has_focus && !user_is_away) + // break; + LL_DEBUGS("Messaging") << "Highlighting" << item->getUUID() << LL_ENDL; + //highlight item - if (view->getPanel()) - { LLFocusableElement* focus_ctrl = gFocusMgr.getKeyboardFocus(); - view->getPanel()->setSelection(item->getUUID(), TAKE_FOCUS_NO); + active_panel->setSelection(item->getUUID(), TAKE_FOCUS_NO); gFocusMgr.setKeyboardFocus(focus_ctrl); } } @@ -4991,7 +4981,7 @@ void container_inventory_arrived(LLViewerObject* object, gAgent.changeCameraToDefault(); } - LLFloaterInventory* view = LLFloaterInventory::getActiveInventory(); + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(); if (inventory->size() > 2) { @@ -5029,9 +5019,9 @@ void container_inventory_arrived(LLViewerObject* object, } } gInventory.notifyObservers(); - if(view) + if(active_panel) { - view->getPanel()->setSelection(cat_id, TAKE_FOCUS_NO); + active_panel->setSelection(cat_id, TAKE_FOCUS_NO); } } else if (inventory->size() == 2) @@ -5065,9 +5055,9 @@ void container_inventory_arrived(LLViewerObject* object, new_item->updateServer(TRUE); gInventory.updateItem(new_item); gInventory.notifyObservers(); - if(view) + if(active_panel) { - view->getPanel()->setSelection(item_id, TAKE_FOCUS_NO); + active_panel->setSelection(item_id, TAKE_FOCUS_NO); } } -- cgit v1.2.3 From 963c2240f4584f16b5e003b506c8c608331d8585 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Wed, 2 Dec 2009 16:53:13 +0200 Subject: Update for normal task EXT-2081 - Object IM chiclets art needs to be hooked up to LLDialog chiclets. Disabled notification toast. --HG-- branch : product-engine --- indra/newview/llviewermessage.cpp | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 23d02af73d..76cc9bf335 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5583,17 +5583,6 @@ void process_script_dialog(LLMessageSystem* msg, void**) notification = LLNotifications::instance().add( LLNotification::Params("ScriptDialogGroup").substitutions(args).payload(payload).form_elements(form.asLLSD())); } - - // "ScriptDialog" and "ScriptDialogGroup" are handles by LLScriptFloaterManager. - // We want to inform user that there is a script floater, lets add "ScriptToast" - LLNotification::Params p("ScriptToast"); - p.substitutions(args).payload(payload).functor.function(boost::bind( - LLScriptFloaterManager::onToastButtonClick, _1, _2)); - - notification = LLNotifications::instance().add(p); - - LLScriptFloaterManager::getInstance()->setNotificationToastId( - object_id, notification->getID()); } //--------------------------------------------------------------------------- -- cgit v1.2.3 From e24617a974a41cba0fc9aae10573abd077b0f4e0 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 2 Dec 2009 12:04:31 -0500 Subject: EXT 3046 : INFRASTRUCTURE: Header file includes cleanup for llviewermenu, llviewermessage Removed > 100 header includes from llviewermenu and llviewermessage. --HG-- branch : avatar-pipeline --- indra/newview/llviewermessage.cpp | 56 ++------------------------------------- 1 file changed, 2 insertions(+), 54 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 549be65c2d..a93b5dffb2 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -33,68 +33,31 @@ #include "llviewerprecompiledheaders.h" #include "llviewermessage.h" -// TODO: Remove unnecessary headers. - #include #include "llaudioengine.h" -#include "indra_constants.h" #include "lscript_byteformat.h" -#include "mean_collision_data.h" -#include "llfloaterbump.h" -#include "llassetstorage.h" -#include "llcachename.h" - -#include "lldbstrings.h" #include "lleconomy.h" -#include "llfilepicker.h" #include "llfloaterreg.h" -#include "llfocusmgr.h" #include "llfollowcamparams.h" -#include "llinstantmessage.h" -#include "llquantize.h" -#include "llregionflags.h" -#include "llregionhandle.h" #include "llsdserialize.h" -#include "llstring.h" -#include "llteleportflags.h" -#include "lltracker.h" #include "lltransactionflags.h" -#include "llxfermanager.h" -#include "message.h" -#include "sound_ids.h" -#include "lltimer.h" -#include "llmd5.h" #include "llagent.h" #include "llcallingcard.h" -#include "llconsole.h" -#include "llvieweraudio.h" -#include "llviewercontrol.h" -#include "lldrawpool.h" #include "llfirstuse.h" -#include "llfloateranimpreview.h" #include "llfloaterbuycurrency.h" #include "llfloaterbuyland.h" #include "llfloaterchat.h" -#include "llfloaterimagepreview.h" #include "llfloaterland.h" #include "llfloaterregioninfo.h" #include "llfloaterlandholdings.h" -#include "llurldispatcher.h" #include "llfloaterpostcard.h" #include "llfloaterpreference.h" -#include "llfollowcam.h" -#include "llgroupnotify.h" -#include "llhudeffect.h" #include "llhudeffecttrail.h" #include "llhudmanager.h" -#include "llinventorymodel.h" #include "llinventoryobserver.h" #include "llinventorypanel.h" -#include "llmenugl.h" -#include "llmoveview.h" -#include "llmutelist.h" #include "llnearbychat.h" #include "llnotifications.h" #include "llnotificationsutil.h" @@ -111,22 +74,11 @@ #include "llstatenums.h" #include "llstatusbar.h" #include "llimview.h" -#include "lltool.h" -#include "lltoolbar.h" -#include "lltoolmgr.h" #include "lltrans.h" -#include "llui.h" // for make_ui_sound -#include "lluploaddialog.h" -#include "llviewercamera.h" -#include "llviewerchat.h" #include "llviewergenericmessage.h" -#include "llviewerinventory.h" #include "llviewermenu.h" -#include "llviewerobject.h" #include "llviewerobjectlist.h" #include "llviewerparcelmgr.h" -#include "llviewerpartsource.h" -#include "llviewerregion.h" #include "llviewerstats.h" #include "llviewertexteditor.h" #include "llviewerthrottle.h" @@ -134,10 +86,8 @@ #include "llvlmanager.h" #include "llvoavatarself.h" #include "llvotextbubble.h" -#include "llweb.h" #include "llworld.h" #include "pipeline.h" -#include "llappviewer.h" #include "llfloaterworldmap.h" #include "llviewerdisplay.h" #include "llkeythrottle.h" @@ -146,15 +96,13 @@ #include "llpanelblockedlist.h" #include "llpanelplaceprofile.h" -#include -#include +#include // #if LL_WINDOWS // For Windows specific error handler #include "llwindebug.h" // For the invalid message handler #endif -//#include "llnearbychathistory.h" -#include "llnotificationmanager.h" +#include "llnotificationmanager.h" // // // Constants -- cgit v1.2.3 From bbe2bcf8a2cb0aec94be1838d83beaddd9355061 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 2 Dec 2009 12:15:31 -0500 Subject: EXT 3046 : INFRASTRUCTURE: Header file includes cleanup for llviewermenu, llviewermessage More header file cleanup. --HG-- branch : avatar-pipeline --- indra/newview/llviewermessage.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index a93b5dffb2..4d26f6294c 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -33,8 +33,6 @@ #include "llviewerprecompiledheaders.h" #include "llviewermessage.h" -#include - #include "llaudioengine.h" #include "lscript_byteformat.h" #include "lleconomy.h" -- cgit v1.2.3 From 2adf9d6b0490f7692998f0ed73c981238d5860fe Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Thu, 3 Dec 2009 11:18:59 -0500 Subject: EXT-2410 : Accepting an offered notecard should open the inventorySP Preliminary checkin to improve this infrastructure. --HG-- branch : avatar-pipeline --- indra/newview/llviewermessage.cpp | 91 +++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 51 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 4d26f6294c..c0be9115a9 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -42,6 +42,7 @@ #include "lltransactionflags.h" #include "llagent.h" +#include "llappearancemgr.h" #include "llcallingcard.h" #include "llfirstuse.h" #include "llfloaterbuycurrency.h" @@ -824,35 +825,40 @@ bool check_offer_throttle(const std::string& from_name, bool check_only) void open_inventory_offer(const std::vector& items, const std::string& from_name) { - std::vector::const_iterator it = items.begin(); - std::vector::const_iterator end = items.end(); const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); - LLInventoryItem* item; - for(; it != end; ++it) + const LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); + const LLUUID cof_id = LLAppearanceManager::instance().getCOF(); + const BOOL user_is_away = gAwayTimer.getStarted(); + + for (std::vector::const_iterator item_iter = items.begin(); + item_iter != items.end(); + ++item_iter) { - const LLUUID& id = *it; - item = gInventory.getItem(id); + const LLUUID& item_id = (*item_iter); + LLInventoryItem* item = gInventory.getItem(item_id); if(!item) { - LL_WARNS("Messaging") << "Unable to show inventory item: " << id << LL_ENDL; + LL_WARNS("Messaging") << "Unable to show inventory item: " << item_id << LL_ENDL; continue; } - if(gInventory.isObjectDescendentOf(id, trash_id)) + if(gInventory.isObjectDescendentOf(item_id, trash_id)) { continue; } - LLAssetType::EType asset_type = item->getType(); //if we are throttled, don't display them + const LLAssetType::EType asset_type = item->getType(); if (check_offer_throttle(from_name, false)) { // If we opened this ourselves, focus it - BOOL take_focus = from_name.empty() ? TAKE_FOCUS_YES : TAKE_FOCUS_NO; + const BOOL take_focus = from_name.empty() ? TAKE_FOCUS_YES : TAKE_FOCUS_NO; switch(asset_type) { case LLAssetType::AT_NOTECARD: - LLFloaterReg::showInstance("preview_notecard", LLSD(id), take_focus); - break; + { + LLFloaterReg::showInstance("preview_notecard", LLSD(item_id), take_focus); + break; + } case LLAssetType::AT_LANDMARK: { LLInventoryCategory* parent_folder = gInventory.getCategory(item->getParentUUID()); @@ -862,63 +868,46 @@ void open_inventory_offer(const std::vector& items, const std::string& f LLNotificationsUtil::add("LandmarkCreated", args); // Created landmark is passed to Places panel to allow its editing. - LLPanelPlaces *panel = dynamic_cast(LLSideTray::getInstance()->showPanel("panel_places", LLSD())); - if (panel) + LLPanelPlaces *places_panel = dynamic_cast(LLSideTray::getInstance()->showPanel("panel_places", LLSD())); + if (places_panel) { - panel->setItem(item); + places_panel->setItem(item); } } break; case LLAssetType::AT_TEXTURE: - LLFloaterReg::showInstance("preview_texture", LLSD(id), take_focus); - break; + { + LLFloaterReg::showInstance("preview_texture", LLSD(item_id), take_focus); + break; + } default: break; } } - //highlight item, if it's not in the trash or lost+found - // Don't auto-open the inventory floater - if(gSavedSettings.getBOOL("ShowInInventory") && - asset_type != LLAssetType::AT_CALLINGCARD && - item->getInventoryType() != LLInventoryType::IT_ATTACHMENT && - !from_name.empty()) - { - //TODO:this should be moved to the end of method after all the checks, - //but first decide what to do with active inventory if any (EK) - LLSD key; - key["select"] = item->getUUID(); - LLSideTray::getInstance()->showPanel("sidepanel_inventory", key); - } - LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(); + //////////////////////////////////////////////////////////////////////////////// + // Highlight item if it's not in the trash, lost+found, or COF + const BOOL auto_open = gSavedSettings.getBOOL("ShowInInventory") && + (asset_type != LLAssetType::AT_CALLINGCARD) && + (item->getInventoryType() != LLInventoryType::IT_ATTACHMENT) && + !from_name.empty(); + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(auto_open); if(active_panel) { - //Trash Check - const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); - if(gInventory.isObjectDescendentOf(item->getUUID(), trash_id)) + // Don't select lost and found items if the user is active + if (gInventory.isObjectDescendentOf(item_id, lost_and_found_id) && + !user_is_away) { - return; + continue; } - const LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); - //BOOL inventory_has_focus = gFocusMgr.childHasKeyboardFocus(view); - BOOL user_is_away = gAwayTimer.getStarted(); - - // don't select lost and found items if the user is active - if (gInventory.isObjectDescendentOf(item->getUUID(), lost_and_found_id) - && !user_is_away) + if (gInventory.isObjectDescendentOf(item_id, cof_id)) { - return; + continue; } - //Not sure about this check. Could make it easy to miss incoming items. - //don't dick with highlight while the user is working - //if(inventory_has_focus && !user_is_away) - // break; - LL_DEBUGS("Messaging") << "Highlighting" << item->getUUID() << LL_ENDL; - //highlight item - + LL_DEBUGS("Messaging") << "Highlighting" << item_id << LL_ENDL; LLFocusableElement* focus_ctrl = gFocusMgr.getKeyboardFocus(); - active_panel->setSelection(item->getUUID(), TAKE_FOCUS_NO); + active_panel->setSelection(item_id, TAKE_FOCUS_NO); gFocusMgr.setKeyboardFocus(focus_ctrl); } } -- cgit v1.2.3 From 202d86b15567a783bed55849a7cdc8ad8d8f874f Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Thu, 3 Dec 2009 15:39:43 -0500 Subject: EXT-2410 : Accepting an offered item should open the inventorySP Added a new "Quiet" query for folder types, so I don't have to special case all the folders where we don't want UI notifications from inventory offers. Fixed a bug where a sidepanel was considered active even if the sidetray was closed. --HG-- branch : avatar-pipeline --- indra/newview/llviewermessage.cpp | 40 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 21 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index c0be9115a9..fdc59f4afa 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -42,7 +42,6 @@ #include "lltransactionflags.h" #include "llagent.h" -#include "llappearancemgr.h" #include "llcallingcard.h" #include "llfirstuse.h" #include "llfloaterbuycurrency.h" @@ -74,6 +73,7 @@ #include "llstatusbar.h" #include "llimview.h" #include "lltrans.h" +#include "llviewerfoldertype.h" #include "llviewergenericmessage.h" #include "llviewermenu.h" #include "llviewerobjectlist.h" @@ -825,11 +825,6 @@ bool check_offer_throttle(const std::string& from_name, bool check_only) void open_inventory_offer(const std::vector& items, const std::string& from_name) { - const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); - const LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); - const LLUUID cof_id = LLAppearanceManager::instance().getCOF(); - const BOOL user_is_away = gAwayTimer.getStarted(); - for (std::vector::const_iterator item_iter = items.begin(); item_iter != items.end(); ++item_iter) @@ -841,14 +836,28 @@ void open_inventory_offer(const std::vector& items, const std::string& f LL_WARNS("Messaging") << "Unable to show inventory item: " << item_id << LL_ENDL; continue; } - if(gInventory.isObjectDescendentOf(item_id, trash_id)) + + //////////////////////////////////////////////////////////////////////////////// + // Don't highlight if it's in certain "quiet" folders which don't need UI + // notification (e.g. trash, cof, lost-and-found). + const BOOL user_is_away = gAwayTimer.getStarted(); + if(!user_is_away) { - continue; + const LLViewerInventoryCategory *parent = gInventory.getFirstNondefaultParent(item_id); + if (parent) + { + const LLFolderType::EType parent_type = parent->getPreferredType(); + if (LLViewerFolderType::lookupIsQuietType(parent_type)) + { + continue; + } + } } - //if we are throttled, don't display them + //////////////////////////////////////////////////////////////////////////////// + // Special handling for various types. const LLAssetType::EType asset_type = item->getType(); - if (check_offer_throttle(from_name, false)) + if (check_offer_throttle(from_name, false)) // If we are throttled, don't display { // If we opened this ourselves, focus it const BOOL take_focus = from_name.empty() ? TAKE_FOCUS_YES : TAKE_FOCUS_NO; @@ -894,17 +903,6 @@ void open_inventory_offer(const std::vector& items, const std::string& f LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(auto_open); if(active_panel) { - // Don't select lost and found items if the user is active - if (gInventory.isObjectDescendentOf(item_id, lost_and_found_id) && - !user_is_away) - { - continue; - } - if (gInventory.isObjectDescendentOf(item_id, cof_id)) - { - continue; - } - LL_DEBUGS("Messaging") << "Highlighting" << item_id << LL_ENDL; LLFocusableElement* focus_ctrl = gFocusMgr.getKeyboardFocus(); active_panel->setSelection(item_id, TAKE_FOCUS_NO); -- cgit v1.2.3 From 28a1ee9da8d58955590e3596409d2f49b130e1fc Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Fri, 4 Dec 2009 18:33:13 +0200 Subject: =?UTF-8?q?implemented=20EXT-700=20=E2=80=9C"Offer"=20notification?= =?UTF-8?q?s=20should=20be=20accessible=20via=20chiclet=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/llviewermessage.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 76cc9bf335..c44cebe877 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2074,13 +2074,17 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) case IM_INVENTORY_ACCEPTED: { args["NAME"] = name; - LLNotificationsUtil::add("InventoryAccepted", args); + LLSD payload; + payload["from_id"] = from_id; + LLNotificationsUtil::add("InventoryAccepted", args, payload); break; } case IM_INVENTORY_DECLINED: { args["NAME"] = name; - LLNotificationsUtil::add("InventoryDeclined", args); + LLSD payload; + payload["from_id"] = from_id; + LLNotificationsUtil::add("InventoryDeclined", args, payload); break; } // TODO: _DEPRECATED suffix as part of vote removal - DEV-24856 -- cgit v1.2.3 From da8de2b6742cad3fadad84c9f0640b69a9690f66 Mon Sep 17 00:00:00 2001 From: Denis Serdjuk Date: Mon, 7 Dec 2009 19:42:11 +0200 Subject: implemented Task EXT-2304 Offer Notifications should include a link that highlights the landmark or item in the appropriate side panel Changes: 1.highlighting of landmarks was broken by LLInventoryPanel::getActiveInventoryPanel(). 2. escaping of urls --HG-- branch : product-engine --- indra/newview/llviewermessage.cpp | 94 +++++++++++++++------------------------ 1 file changed, 37 insertions(+), 57 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 558382b0a7..d6b57dfced 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -73,6 +73,7 @@ #include "llstatusbar.h" #include "llimview.h" #include "lltrans.h" +#include "lluri.h" #include "llviewergenericmessage.h" #include "llviewermenu.h" #include "llviewerobjectlist.h" @@ -827,6 +828,8 @@ void open_inventory_offer(const std::vector& items, const std::string& f std::vector::const_iterator it = items.begin(); std::vector::const_iterator end = items.end(); const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); + const LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); + BOOL user_is_away = gAwayTimer.getStarted(); LLInventoryItem* item; for(; it != end; ++it) { @@ -837,7 +840,10 @@ void open_inventory_offer(const std::vector& items, const std::string& f LL_WARNS("Messaging") << "Unable to show inventory item: " << id << LL_ENDL; continue; } - if(gInventory.isObjectDescendentOf(id, trash_id)) + // don't select trash or lost and found items if the user is active + if(gInventory.isObjectDescendentOf(id, trash_id) || + (gInventory.isObjectDescendentOf(item->getUUID(), lost_and_found_id) + && !user_is_away) ) { continue; } @@ -846,6 +852,7 @@ void open_inventory_offer(const std::vector& items, const std::string& f //if we are throttled, don't display them if (check_offer_throttle(from_name, false)) { + LL_DEBUGS("Messaging") << "Highlighting inventory item: " << item->getUUID() << LL_ENDL; // If we opened this ourselves, focus it BOOL take_focus = from_name.empty() ? TAKE_FOCUS_YES : TAKE_FOCUS_NO; switch(asset_type) @@ -856,71 +863,44 @@ void open_inventory_offer(const std::vector& items, const std::string& f case LLAssetType::AT_LANDMARK: { LLInventoryCategory* parent_folder = gInventory.getCategory(item->getParentUUID()); - LLSD args; - args["LANDMARK_NAME"] = item->getName(); - args["FOLDER_NAME"] = std::string(parent_folder ? parent_folder->getName() : "unknown"); - LLNotificationsUtil::add("LandmarkCreated", args); - - // Created landmark is passed to Places panel to allow its editing. - LLPanelPlaces *panel = dynamic_cast(LLSideTray::getInstance()->showPanel("panel_places", LLSD())); - if (panel) + if ("inventory_handler" == from_name) { - panel->setItem(item); + //we have to filter inventory_handler messages to avoid notification displaying + LLSideTray::getInstance()->showPanel("panel_places", + LLSD().with("type", "landmark").with("id", item->getUUID())); } - } + else if(from_name.empty()) + { + // we receive a message from LLOpenTaskOffer, it mean that new landmark has been added. + LLSD args; + args["LANDMARK_NAME"] = item->getName(); + args["FOLDER_NAME"] = std::string(parent_folder ? parent_folder->getName() : "unknown"); + LLNotificationsUtil::add("LandmarkCreated", args); + // Created landmark is passed to Places panel to allow its editing. In fact panel should be already displayed. + //TODO*:: dserduk(7/12/09) remove LLPanelPlaces dependency from here + LLPanelPlaces *panel = dynamic_cast(LLSideTray::getInstance()->showPanel("panel_places", LLSD())); + if (panel) + { + panel->setItem(item); + } + } + } break; case LLAssetType::AT_TEXTURE: LLFloaterReg::showInstance("preview_texture", LLSD(id), take_focus); break; default: + if(gSavedSettings.getBOOL("ShowInInventory") && + asset_type != LLAssetType::AT_CALLINGCARD && + item->getInventoryType() != LLInventoryType::IT_ATTACHMENT && + !from_name.empty()) + { + LLSideTray::getInstance()->showPanel("sidepanel_inventory", + LLSD().with("select", item->getUUID())); + } break; } } - //highlight item, if it's not in the trash or lost+found - - // Don't auto-open the inventory floater - if(gSavedSettings.getBOOL("ShowInInventory") && - asset_type != LLAssetType::AT_CALLINGCARD && - item->getInventoryType() != LLInventoryType::IT_ATTACHMENT && - !from_name.empty()) - { - //TODO:this should be moved to the end of method after all the checks, - //but first decide what to do with active inventory if any (EK) - LLSD key; - key["select"] = item->getUUID(); - LLSideTray::getInstance()->showPanel("sidepanel_inventory", key); - } - LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(); - if(active_panel) - { - //Trash Check - const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); - if(gInventory.isObjectDescendentOf(item->getUUID(), trash_id)) - { - return; - } - const LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); - //BOOL inventory_has_focus = gFocusMgr.childHasKeyboardFocus(view); - BOOL user_is_away = gAwayTimer.getStarted(); - - // don't select lost and found items if the user is active - if (gInventory.isObjectDescendentOf(item->getUUID(), lost_and_found_id) - && !user_is_away) - { - return; - } - - //Not sure about this check. Could make it easy to miss incoming items. - //don't dick with highlight while the user is working - //if(inventory_has_focus && !user_is_away) - // break; - LL_DEBUGS("Messaging") << "Highlighting" << item->getUUID() << LL_ENDL; - //highlight item - - LLFocusableElement* focus_ctrl = gFocusMgr.getKeyboardFocus(); - active_panel->setSelection(item->getUUID(), TAKE_FOCUS_NO); - gFocusMgr.setKeyboardFocus(focus_ctrl); - } } } @@ -1461,7 +1441,7 @@ void inventory_offer_handler(LLOfferInfo* info) args["OBJECTFROMNAME"] = info->mFromName; args["NAME"] = info->mFromName; args["NAME_SLURL"] = LLSLURL::buildCommand("agent", info->mFromID, "about"); - std::string verb = "select?name=" + msg; + std::string verb = "select?name=" + LLURI::escape(msg); args["ITEM_SLURL"] = LLSLURL::buildCommand("inventory", info->mObjectID, verb.c_str()); LLNotification::Params p("ObjectGiveItem"); -- cgit v1.2.3 From 4a8733fadd54a44eb59bd4b80c7e727ccdc0c540 Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Mon, 7 Dec 2009 22:04:02 +0200 Subject: No ticket. Removed inventory offer fake notification. --HG-- branch : product-engine --- indra/newview/llviewermessage.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index d6b57dfced..c4a2e88db5 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1480,14 +1480,15 @@ void inventory_offer_handler(LLOfferInfo* info) } // Pop up inv offer notification and let the user accept (keep), or reject (and silently delete) the inventory. - LLNotifications::instance().add(p); + LLNotifications::instance().add(p); + // TODO(EM): Recheck this after we will know how script notifications should look like. // Inform user that there is a script floater via toast system - { - payload["give_inventory_notification"] = TRUE; - LLNotificationPtr notification = LLNotifications::instance().add(p.payload(payload)); - LLScriptFloaterManager::getInstance()->setNotificationToastId(object_id, notification->getID()); - } + // { + // payload["give_inventory_notification"] = TRUE; + // LLNotificationPtr notification = LLNotifications::instance().add(p.payload(payload)); + // LLScriptFloaterManager::getInstance()->setNotificationToastId(object_id, notification->getID()); + // } } bool lure_callback(const LLSD& notification, const LLSD& response) -- cgit v1.2.3 From 5245fb69721bf4b70de85211da6721b0e0137e07 Mon Sep 17 00:00:00 2001 From: Steve Bennetts Date: Mon, 7 Dec 2009 17:07:52 -0800 Subject: merge fixes --- indra/newview/llviewermessage.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 39d69067da..8c0529e344 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -829,8 +829,6 @@ void open_inventory_offer(const std::vector& items, const std::string& f for (std::vector::const_iterator item_iter = items.begin(); item_iter != items.end(); ++item_iter) - const LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); - BOOL user_is_away = gAwayTimer.getStarted(); { const LLUUID& item_id = (*item_iter); LLInventoryItem* item = gInventory.getItem(item_id); @@ -839,6 +837,7 @@ void open_inventory_offer(const std::vector& items, const std::string& f LL_WARNS("Messaging") << "Unable to show inventory item: " << item_id << LL_ENDL; continue; } + //////////////////////////////////////////////////////////////////////////////// // Don't highlight if it's in certain "quiet" folders which don't need UI // notification (e.g. trash, cof, lost-and-found). -- cgit v1.2.3