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