From 0f6242d9fd948cda1abf18885eef320b22d310c5 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 10 Nov 2009 14:00:38 -0800 Subject: Sanitize naming of getWindowRect (scaled vs. raw pixels) and getWorldViewRect (scaled vs. raw) Reduces chance of future UI bugs related to UI size. Discussed with Richard. --- indra/newview/llviewermessage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index ea1097c477..a90790c59a 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4338,7 +4338,7 @@ void process_alert_core(const std::string& message, BOOL modal) std::string snap_filename = gDirUtilp->getLindenUserDir(); snap_filename += gDirUtilp->getDirDelimiter(); snap_filename += SCREEN_HOME_FILENAME; - gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight(), FALSE, FALSE); + gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE); } const std::string ALERT_PREFIX("ALERT: "); -- cgit v1.2.3 From 2afc64e6fa8aa0ee41290c8232733881026cab10 Mon Sep 17 00:00:00 2001 From: Eugene Kondrashev Date: Wed, 11 Nov 2009 13:08:02 +0200 Subject: Fixed Normal bug EXT-1959 - [BSI] emotes difficult to see in IM/Group chat --HG-- branch : product-engine --- indra/newview/llviewermessage.cpp | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index ea1097c477..bb61b4e16f 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1498,15 +1498,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } std::string separator_string(": "); - int message_offset = 0; - - //Handle IRC styled /me messages. - std::string prefix = message.substr(0, 4); - if (prefix == "/me " || prefix == "/me'") - { - separator_string = ""; - message_offset = 3; - } LLSD args; switch(dialog) @@ -1558,7 +1549,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // now store incoming IM in chat history - buffer = message.substr(message_offset); + buffer = message; LL_INFOS("Messaging") << "process_improved_im: session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL; @@ -1576,7 +1567,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) true); // pretend this is chat generated by self, so it does not show up on screen - chat.mText = std::string("IM: ") + name + separator_string + message.substr(message_offset); + chat.mText = std::string("IM: ") + name + separator_string + message; LLFloaterChat::addChat( chat, TRUE, TRUE ); } else if (from_id.isNull()) @@ -1596,7 +1587,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // Treat like a system message and put in chat history. // Claim to be from a local agent so it doesn't go into // console. - chat.mText = name + separator_string + message.substr(message_offset); + chat.mText = name + separator_string + message; LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance("nearby_chat", LLSD()); if(nearby_chat) @@ -1612,7 +1603,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) { saved = llformat("(Saved %s) ", formatted_time(timestamp).c_str()); } - buffer = saved + message.substr(message_offset); + buffer = saved + message; LL_INFOS("Messaging") << "process_improved_im: session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL; @@ -1634,7 +1625,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) region_id, position, true); - chat.mText = std::string("IM: ") + name + separator_string + saved + message.substr(message_offset); + chat.mText = std::string("IM: ") + name + separator_string + saved + message; BOOL local_agent = FALSE; LLFloaterChat::addChat( chat, TRUE, local_agent ); @@ -1922,7 +1913,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) { saved = llformat("(Saved %s) ", formatted_time(timestamp).c_str()); } - buffer = saved + message.substr(message_offset); + buffer = saved + message; BOOL is_this_agent = FALSE; if(from_id == gAgentID) { @@ -1940,7 +1931,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) position, true); - chat.mText = std::string("IM: ") + name + separator_string + saved + message.substr(message_offset); + chat.mText = std::string("IM: ") + name + separator_string + saved + message; LLFloaterChat::addChat(chat, TRUE, is_this_agent); } break; @@ -1953,7 +1944,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } LLSD substitutions; - substitutions["MSG"] = message.substr(message_offset); + substitutions["MSG"] = message; LLNotifications::instance().add("ServerObjectMessage", substitutions); } break; @@ -1978,7 +1969,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) else { // TODO: after LLTrans hits release, get "busy response" into translatable file - buffer = llformat("%s (%s): %s", name.c_str(), "busy response", message.substr(message_offset).c_str()); + buffer = llformat("%s (%s): %s", name.c_str(), "busy response", message.c_str()); gIMMgr->addMessage(session_id, from_id, name, buffer); } break; -- cgit v1.2.3 From 393f68c1a9785b29adc210124e342af24937d5f5 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Thu, 12 Nov 2009 12:36:30 +0000 Subject: DEV-2925: Added a new remote object inspector. This is used to display details about objects that may not be in the current scene (the existing object inspector is tied to selection and only works for objects in the scene). The remote inspector lets you see the name and owner of the object. You can also teleport to the object's location, view the location on the map, or mute the object. I've also added more information to the notification you receive when an object sends you an IM via llInstantMessage(). This notification now has an "Inspect" button that brings up the remote object inspector. --- indra/newview/llviewermessage.cpp | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index a90790c59a..6d6fc5f49f 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1431,6 +1431,17 @@ bool goto_url_callback(const LLSD& notification, const LLSD& response) } static LLNotificationFunctorRegistration goto_url_callback_reg("GotoURL", goto_url_callback); +bool inspect_remote_object_callback(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotification::getSelectedOption(notification, response); + if (0 == option) + { + LLFloaterReg::showInstance("inspect_remote_object", notification["payload"]); + } + return false; +} +static LLNotificationFunctorRegistration inspect_remote_object_callback_reg("ServerObjectMessage", inspect_remote_object_callback); + void process_improved_im(LLMessageSystem *msg, void **user_data) { if (gNoRender) @@ -1952,9 +1963,24 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) return; } + // Build a link to open the object IM info window. + std::string location = ll_safe_string((char*)binary_bucket,binary_bucket_size); + LLStringUtil::trim(location); + LLSD substitutions; + substitutions["NAME"] = name; substitutions["MSG"] = message.substr(message_offset); - LLNotifications::instance().add("ServerObjectMessage", substitutions); + + LLSD payload; + payload["object_id"] = session_id; + payload["owner_id"] = from_id; + payload["slurl"] = location; + payload["name"] = name; + if (from_group) + { + payload["groupowned"] = "true"; + } + LLNotifications::instance().add("ServerObjectMessage", substitutions, payload); } break; case IM_FROM_TASK_AS_ALERT: -- cgit v1.2.3 From 40731c7eb89fc6e59b0b872b3c21ffe84913db1d Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Thu, 12 Nov 2009 12:57:34 +0000 Subject: DEV-2925: Remove a null char at the end of the location string. --- 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 6d6fc5f49f..be3c45059f 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1964,8 +1964,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } // Build a link to open the object IM info window. - std::string location = ll_safe_string((char*)binary_bucket,binary_bucket_size); - LLStringUtil::trim(location); + std::string location = ll_safe_string((char*)binary_bucket, binary_bucket_size-1); LLSD substitutions; substitutions["NAME"] = name; -- cgit v1.2.3 From 11fc2da6fa5fba0bb659dd97f8533e4529aece06 Mon Sep 17 00:00:00 2001 From: angela Date: Thu, 12 Nov 2009 21:20:18 +0800 Subject: make color and font affecting both nearby chat and toasts --- indra/newview/llviewermessage.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index a90790c59a..921868d448 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -43,7 +43,7 @@ #include "llfloaterbump.h" #include "llassetstorage.h" #include "llcachename.h" -#include "llchat.h" + #include "lldbstrings.h" #include "lleconomy.h" #include "llfilepicker.h" @@ -115,6 +115,7 @@ #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" @@ -2232,7 +2233,7 @@ void process_decline_callingcard(LLMessageSystem* msg, void**) void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) { - LLChat chat; + LLChat chat; std::string mesg; std::string from_name; U8 source_temp; @@ -2832,7 +2833,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) // Chat the "back" SLURL. (DEV-4907) LLChat chat("Teleport completed from " + gAgent.getTeleportSourceSLURL()); chat.mSourceType = CHAT_SOURCE_SYSTEM; - LLFloaterChat::addChatHistory(chat); + LLFloaterChat::addChatHistory(chat); // Set the new position avatarp->setPositionAgent(agent_pos); @@ -4604,7 +4605,7 @@ void notify_cautioned_script_question(const LLSD& notification, const LLSD& resp if (caution) { LLChat chat(notice.getString()); - LLFloaterChat::addChat(chat, FALSE, FALSE); + // LLFloaterChat::addChat(chat, FALSE, FALSE); } } } -- cgit v1.2.3 From e310e18481b5a69b2a7e0ae89d8491cc601d3af0 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Fri, 13 Nov 2009 18:11:11 +0200 Subject: implemented EXT-1286 "Need support for [ITEM_ICON], [AN_OBJECTTYPE], [ITEM_SLURL], in notifications.xml" --HG-- branch : product-engine --- indra/newview/llviewermessage.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 4088eafe16..b1efec83e6 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1365,7 +1365,9 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) payload["from_id"] = info->mFromID; args["OBJECTFROMNAME"] = info->mFromName; - args["NAME"] = info->mFromName; + args["NAME"] = LLSLURL::buildCommand("agent", info->mFromID, "about"); + std::string verb = "highlight?name=" + msg; + args["ITEM_SLURL"] = LLSLURL::buildCommand("inventory", info->mObjectID, verb.c_str()); LLNotification::Params p("ObjectGiveItem"); p.substitutions(args).payload(payload).functor.function(boost::bind(&LLOfferInfo::inventory_offer_callback, info, _1, _2)); -- cgit v1.2.3 From f0cd44a6a2c4001111e82425cf2bd4fee63fad27 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 13 Nov 2009 16:18:53 -0500 Subject: EXT-2482 : Newly created folders have wrong default type Removed AT_ROOT_CATEGORY and FT_ROOT_CATEGORY since those types are unused. Changed FT_CATEGORY to FT_ROOT_INVENTORY to make its purpose more clear. This change assumes that no agent inventories have category type 9 for either inventory type or folder preferred type. --HG-- branch : avatar-pipeline --- indra/newview/llviewermessage.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 4088eafe16..f0c1823def 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4833,8 +4833,7 @@ void container_inventory_arrived(LLViewerObject* object, InventoryObjectList::const_iterator end = inventory->end(); for ( ; it != end; ++it) { - if ((*it)->getType() != LLAssetType::AT_CATEGORY && - (*it)->getType() != LLAssetType::AT_ROOT_CATEGORY) + if ((*it)->getType() != LLAssetType::AT_CATEGORY) { LLInventoryObject* obj = (LLInventoryObject*)(*it); LLInventoryItem* item = (LLInventoryItem*)(obj); @@ -4869,8 +4868,7 @@ void container_inventory_arrived(LLViewerObject* object, // one actual object InventoryObjectList::iterator it = inventory->begin(); - if ((*it)->getType() == LLAssetType::AT_CATEGORY || - (*it)->getType() == LLAssetType::AT_ROOT_CATEGORY) + if ((*it)->getType() == LLAssetType::AT_CATEGORY) { ++it; } -- cgit v1.2.3 From acdce232994fce7edf9a67a360db2368c5ad6594 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 13 Nov 2009 17:47:00 -0500 Subject: Header file cleanup Removed unnecessary "#include llinventorymodel.h" now that llinventoryobserver was split from llinventorymodel. --HG-- branch : avatar-pipeline --- indra/newview/llviewermessage.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index f0c1823def..7f25e567d0 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -89,6 +89,7 @@ #include "llhudeffecttrail.h" #include "llhudmanager.h" #include "llinventorymodel.h" +#include "llinventoryobserver.h" #include "llinventorypanel.h" #include "llfloaterinventory.h" #include "llmenugl.h" -- cgit v1.2.3 From 1baf1d218644ac5dc00d9b41119a1ef168c709a2 Mon Sep 17 00:00:00 2001 From: angela Date: Mon, 16 Nov 2009 20:46:40 +0800 Subject: fix chat format for /me --- indra/newview/llviewermessage.cpp | 40 +++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 0153116887..ef6a621323 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2343,14 +2343,14 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) std::string prefix = mesg.substr(0, 4); if (prefix == "/me " || prefix == "/me'") { - chat.mText = from_name; - chat.mText += mesg.substr(3); +// chat.mText = from_name; +// chat.mText += mesg.substr(3); ircstyle = TRUE; } - else - { +// else +// { chat.mText = mesg; - } +// } // Look for the start of typing so we can put "..." in the bubbles. if (CHAT_TYPE_START == chat.mChatType) @@ -2376,19 +2376,6 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) return; } - // We have a real utterance now, so can stop showing "..." and proceed. - if (chatter && chatter->isAvatar()) - { - LLLocalSpeakerMgr::getInstance()->setSpeakerTyping(from_id, FALSE); - ((LLVOAvatar*)chatter)->stopTyping(); - - if (!is_muted && !is_busy) - { - visible_in_chat_bubble = gSavedSettings.getBOOL("UseChatBubbles"); - ((LLVOAvatar*)chatter)->addChat(chat); - } - } - // Look for IRC-style emotes if (ircstyle) { @@ -2428,6 +2415,23 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) chat.mText += mesg; } + // We have a real utterance now, so can stop showing "..." and proceed. + if (chatter && chatter->isAvatar()) + { + LLLocalSpeakerMgr::getInstance()->setSpeakerTyping(from_id, FALSE); + ((LLVOAvatar*)chatter)->stopTyping(); + + if (!is_muted && !is_busy) + { + visible_in_chat_bubble = gSavedSettings.getBOOL("UseChatBubbles"); + std::string formated_msg = ""; + LLViewerChat::formatChatMsg(chat, formated_msg); + LLChat chat_bubble = chat; + chat_bubble.mText = formated_msg; + ((LLVOAvatar*)chatter)->addChat(chat_bubble); + } + } + if (chatter) { chat.mPosAgent = chatter->getPositionAgent(); -- cgit v1.2.3 From fce52249abdba7a865f03c88692a45e8ff972763 Mon Sep 17 00:00:00 2001 From: Eugene Kondrashev Date: Wed, 18 Nov 2009 16:04:41 +0200 Subject: Particial fix for normal bug EXT-2410- Accepting an Offered Notecard Should Open the Side Bar Inventory Tab. Added select command while opening inventory sidetray panel --HG-- branch : product-engine --- indra/newview/llviewermessage.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index ef6a621323..11b2f07f1b 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -939,6 +939,11 @@ void open_offer(const std::vector& items, const std::string& from_name) !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 { -- cgit v1.2.3 From 88cce61b09d225df0bcd8aab9dbd2c5a01ee7e19 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Thu, 19 Nov 2009 11:21:20 +0200 Subject: related to EXT-700 '"Offer" notifications should be accessible via chiclet' made 'FriendshipAccepted' notification show correct avatar icon; avoided empty avatar name on 'OfferFriendship' notifiaction; avoided creating IM session on offer from objects; --HG-- branch : product-engine --- indra/newview/llviewermessage.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 11b2f07f1b..8db6d5917a 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1372,7 +1372,8 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) payload["from_id"] = info->mFromID; args["OBJECTFROMNAME"] = info->mFromName; - args["NAME"] = LLSLURL::buildCommand("agent", info->mFromID, "about"); + args["NAME"] = info->mFromName; + args["NAME_SLURL"] = LLSLURL::buildCommand("agent", info->mFromID, "about"); std::string verb = "highlight?name=" + msg; args["ITEM_SLURL"] = LLSLURL::buildCommand("inventory", info->mObjectID, verb.c_str()); @@ -2115,7 +2116,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) send_generic_message("requestonlinenotification", strings); args["NAME"] = name; - LLNotifications::instance().add("FriendshipAccepted", args); + LLSD payload; + payload["from_id"] = from_id; + LLNotifications::instance().add("FriendshipAccepted", args, payload); } break; -- cgit v1.2.3 From 13a6077b780117be0fa3a054426d139ca1d35df9 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Fri, 20 Nov 2009 19:17:38 +0200 Subject: Implemented normal task EXT-2081 - Object IM chiclets art needs to be hooked up to LLDialog chiclets. Implemented LLDialog(LLScriptFloater) and Script Chiclets. --HG-- branch : product-engine --- indra/newview/llviewermessage.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 8db6d5917a..ac1f366f9c 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -101,6 +101,7 @@ #include "llpanelgrouplandmoney.h" #include "llpanelplaces.h" #include "llrecentpeople.h" +#include "llscriptfloater.h" #include "llselectmgr.h" #include "llsidetray.h" #include "llstartup.h" @@ -5380,6 +5381,15 @@ void process_script_dialog(LLMessageSystem* msg, void**) notification = LLNotifications::instance().add( LLNotification::Params("ScriptDialogGroup").substitutions(args).payload(payload).form_elements(form.asLLSD())); } + + LLNotification::Params p("ScriptToast"); + p.substitutions(args).payload(payload).functor.function(boost::bind( + LLScriptFloaterManager::onToastButtonClick, _1, _2)); + + notification = LLNotifications::instance().add(p); + + LLScriptFloaterManager::getInstance()->setToastNotificationId( + object_id, notification->getID()); } //--------------------------------------------------------------------------- -- cgit v1.2.3 From a3930c7ff754e09a686d4ec0eaeca0a7f752c008 Mon Sep 17 00:00:00 2001 From: "Eric M. Tulla (BigPapi)" Date: Fri, 20 Nov 2009 19:27:33 -0500 Subject: Inventory Offer changes and clickable inventory slurls --- indra/newview/llviewermessage.cpp | 196 ++++++++++++++++++++------------------ 1 file changed, 105 insertions(+), 91 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index ef6a621323..d824b1d708 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -726,7 +726,7 @@ public: LLOpenAgentOffer(const std::string& from_name) : mFromName(from_name) {} /*virtual*/ void done() { - open_offer(mComplete, mFromName); + open_inventory_offer(mComplete, mFromName); gInventory.removeObserver(this); delete this; } @@ -875,7 +875,7 @@ bool check_offer_throttle(const std::string& from_name, bool check_only) } } -void open_offer(const std::vector& items, const std::string& from_name) +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(); @@ -1060,22 +1060,8 @@ LLSD LLOfferInfo::asLLSD() return sd; } -bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& response) - { - LLChat chat; - std::string log_message; - S32 button = LLNotification::getSelectedOption(notification, response); - - // For muting, we need to add the mute, then decline the offer. - // This must be done here because: - // * callback may be called immediately, - // * adding the mute sends a message, - // * we can't build two messages at once. - if (2 == button) - { - gCacheName->get(mFromID, mFromGroup, &inventory_offer_mute_callback); - } - +void LLOfferInfo::send_auto_receive_response(void) +{ LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_ImprovedInstantMessage); msg->nextBlockFast(_PREHASH_AgentData); @@ -1094,6 +1080,31 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& msg->addU32Fast(_PREHASH_ParentEstateID, 0); msg->addUUIDFast(_PREHASH_RegionID, LLUUID::null); msg->addVector3Fast(_PREHASH_Position, gAgent.getPositionAgent()); + + // Auto Receive Message. The math for the dialog works, because the accept + // for inventory_offered, task_inventory_offer or + // group_notice_inventory is 1 greater than the offer integer value. + // Generates IM_INVENTORY_ACCEPTED, IM_TASK_INVENTORY_ACCEPTED, + // or IM_GROUP_NOTICE_INVENTORY_ACCEPTED + msg->addU8Fast(_PREHASH_Dialog, (U8)(mIM + 1)); + msg->addBinaryDataFast(_PREHASH_BinaryBucket, &(mFolderID.mData), + sizeof(mFolderID.mData)); + // send the message + msg->sendReliable(mHost); + + if(IM_INVENTORY_OFFERED == mIM) + { + // add buddy to recent people list + LLRecentPeople::instance().add(mFromID); + } +} + +bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& response) +{ + LLChat chat; + std::string log_message; + S32 button = LLNotification::getSelectedOption(notification, response); + LLInventoryObserver* opener = NULL; LLViewerInventoryCategory* catp = NULL; catp = (LLViewerInventoryCategory*)gInventory.getCategory(mObjectID); @@ -1102,6 +1113,16 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& { itemp = (LLViewerInventoryItem*)gInventory.getItem(mObjectID); } + + // For muting, we need to add the mute, then decline the offer. + // This must be done here because: + // * callback may be called immediately, + // * adding the mute sends a message, + // * we can't build two messages at once. + if (2 == button) + { + gCacheName->get(mFromID, mFromGroup, &inventory_offer_mute_callback); + } std::string from_string; // Used in the pop-up. std::string chatHistory_string; // Used in chat history. @@ -1152,64 +1173,54 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& switch(button) { - case IOR_ACCEPT: - // ACCEPT. The math for the dialog works, because the accept - // for inventory_offered, task_inventory_offer or - // group_notice_inventory is 1 greater than the offer integer value. - // Generates IM_INVENTORY_ACCEPTED, IM_TASK_INVENTORY_ACCEPTED, - // or IM_GROUP_NOTICE_INVENTORY_ACCEPTED - msg->addU8Fast(_PREHASH_Dialog, (U8)(mIM + 1)); - msg->addBinaryDataFast(_PREHASH_BinaryBucket, &(mFolderID.mData), - sizeof(mFolderID.mData)); - // send the message - msg->sendReliable(mHost); - - //don't spam them if they are getting flooded - if (check_offer_throttle(mFromName, true)) - { - log_message = chatHistory_string + " " + LLTrans::getString("InvOfferGaveYou") + " " + mDesc + LLTrans::getString("."); - chat.mText = log_message; - LLFloaterChat::addChatHistory(chat); - } - + case IOR_SHOW: // we will want to open this item when it comes back. LL_DEBUGS("Messaging") << "Initializing an opener for tid: " << mTransactionID << LL_ENDL; switch (mIM) { case IM_INVENTORY_OFFERED: - { - // This is an offer from an agent. In this case, the back - // end has already copied the items into your inventory, - // so we can fetch it out of our inventory. - LLInventoryFetchObserver::item_ref_t items; - items.push_back(mObjectID); - LLOpenAgentOffer* open_agent_offer = new LLOpenAgentOffer(from_string); - open_agent_offer->fetchItems(items); - if(catp || (itemp && itemp->isComplete())) - { - open_agent_offer->done(); - } - else { - opener = open_agent_offer; + // This is an offer from an agent. In this case, the back + // end has already copied the items into your inventory, + // so we can fetch it out of our inventory. + LLInventoryFetchObserver::item_ref_t items; + items.push_back(mObjectID); + LLOpenAgentOffer* open_agent_offer = new LLOpenAgentOffer(from_string); + open_agent_offer->fetchItems(items); + if(catp || (itemp && itemp->isComplete())) + { + open_agent_offer->done(); + } + else + { + opener = open_agent_offer; + } } - } break; case IM_TASK_INVENTORY_OFFERED: case IM_GROUP_NOTICE: case IM_GROUP_NOTICE_REQUESTED: - { // This is an offer from a task or group. // We don't use a new instance of an opener // We instead use the singular observer gOpenTaskOffer // Since it already exists, we don't need to actually do anything - } - break; + break; default: LL_WARNS("Messaging") << "inventory_offer_callback: unknown offer type" << LL_ENDL; break; } // end switch (mIM) + + // Show falls through to accept. + + case IOR_ACCEPT: + //don't spam them if they are getting flooded + if (check_offer_throttle(mFromName, true)) + { + log_message = chatHistory_string + " " + LLTrans::getString("InvOfferGaveYou") + " " + mDesc + LLTrans::getString("."); + chat.mText = log_message; + LLFloaterChat::addChatHistory(chat); + } break; case IOR_BUSY: @@ -1218,31 +1229,15 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& case IOR_MUTE: // MUTE falls through to decline case IOR_DECLINE: - // DECLINE. The math for the dialog works, because the decline - // for inventory_offered, task_inventory_offer or - // group_notice_inventory is 2 greater than the offer integer value. - // Generates IM_INVENTORY_DECLINED, IM_TASK_INVENTORY_DECLINED, - // or IM_GROUP_NOTICE_INVENTORY_DECLINED - default: - // close button probably (or any of the fall-throughs from above) - msg->addU8Fast(_PREHASH_Dialog, (U8)(mIM + 2)); - msg->addBinaryDataFast(_PREHASH_BinaryBucket, EMPTY_BINARY_BUCKET, EMPTY_BINARY_BUCKET_SIZE); - // send the message - msg->sendReliable(mHost); - - log_message = LLTrans::getString("InvOfferYouDecline") + " " + mDesc + " " + LLTrans::getString("InvOfferFrom") + " " + mFromName +"."; - chat.mText = log_message; - if( LLMuteList::getInstance()->isMuted(mFromID ) && ! LLMuteList::getInstance()->isLinden(mFromName) ) // muting for SL-42269 - { - chat.mMuted = TRUE; - } - LLFloaterChat::addChatHistory(chat); - - // If it's from an agent, we have to fetch the item to throw - // it away. If it's from a task or group, just denying the - // request will suffice to discard the item. - if(IM_INVENTORY_OFFERED == mIM) { + log_message = LLTrans::getString("InvOfferYouDecline") + " " + mDesc + " " + LLTrans::getString("InvOfferFrom") + " " + mFromName +"."; + chat.mText = log_message; + if( LLMuteList::getInstance()->isMuted(mFromID ) && ! LLMuteList::getInstance()->isLinden(mFromName) ) // muting for SL-42269 + { + chat.mMuted = TRUE; + } + LLFloaterChat::addChatHistory(chat); + LLInventoryFetchComboObserver::folder_ref_t folders; LLInventoryFetchComboObserver::item_ref_t items; items.push_back(mObjectID); @@ -1258,20 +1253,21 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& opener = discard_agent_offer; } + + if (busy && (!mFromGroup && !mFromObject)) + { + busy_message(gMessageSystem, mFromID); + } + break; } - if (busy && (!mFromGroup && !mFromObject)) - { - busy_message(msg,mFromID); - } + default: + // close button probably + // The item has already been fetched and is in your inventory, we simply won't highlight it + // OR delete it if the notification gets killed, since we don't want that to be a vector for + // losing inventory offers. break; } - if(IM_INVENTORY_OFFERED == mIM) - { - // add buddy to recent people list - LLRecentPeople::instance().add(mFromID); - } - if(opener) { gInventory.addObserver(opener); @@ -1382,7 +1378,25 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) { p.name = "UserGiveItem"; } - + + // Prefetch the item into your local inventory. + LLInventoryFetchObserver::item_ref_t items; + items.push_back(info->mObjectID); + LLInventoryFetchObserver* fetch_item = new LLInventoryFetchObserver(); + fetch_item->fetchItems(items); + if(fetch_item->isEverythingComplete()) + { + fetch_item->done(); + } + else + { + gInventory.addObserver(fetch_item); + } + + // 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); } -- cgit v1.2.3 From 9f0dbcf4c0c6c8621c377fd7f9e417aa76acd836 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Mon, 23 Nov 2009 15:50:49 +0200 Subject: Update for task EXT-2081 - Object IM chiclets art needs to be hooked up to LLDialog chiclets. Cleaned code, added comments. --HG-- branch : product-engine --- indra/newview/llviewermessage.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index ac1f366f9c..4d7d3ee8ac 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5382,13 +5382,15 @@ void process_script_dialog(LLMessageSystem* msg, void**) 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()->setToastNotificationId( + LLScriptFloaterManager::getInstance()->setNotificationToastId( object_id, notification->getID()); } -- cgit v1.2.3 From 2bdf430de13577e855a7a1f400173f6cd4ab8ac6 Mon Sep 17 00:00:00 2001 From: "Eric M. Tulla (BigPapi)" Date: Mon, 23 Nov 2009 19:59:47 -0500 Subject: small fixes for inv slurl functionality --- 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 b2693c799c..7eed40589b 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -169,7 +169,6 @@ static const F32 LLREQUEST_PERMISSION_THROTTLE_INTERVAL = 10.0f; // seconds extern BOOL gDebugClicks; // function prototypes -void open_offer(const std::vector& items, const std::string& from_name); bool check_offer_throttle(const std::string& from_name, bool check_only); //inventory offer throttle globals @@ -744,7 +743,7 @@ class LLOpenTaskOffer : public LLInventoryAddedObserver protected: /*virtual*/ void done() { - open_offer(mAdded, ""); + open_inventory_offer(mAdded, ""); mAdded.clear(); } }; -- cgit v1.2.3 From 88a56949d5b121132e3a068c72ab370834d72ceb Mon Sep 17 00:00:00 2001 From: "Eric M. Tulla (BigPapi)" Date: Tue, 24 Nov 2009 15:43:29 -0500 Subject: made task inventory offers work the old way, and disabled inv slurls for them. --- indra/newview/llviewermessage.cpp | 271 +++++++++++++++++++++++++++++--------- 1 file changed, 206 insertions(+), 65 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 7eed40589b..eaffa75298 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1130,48 +1130,9 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& std::string from_string; // Used in the pop-up. std::string chatHistory_string; // Used in chat history. - if (mFromObject == TRUE) - { - if (mFromGroup) - { - std::string group_name; - if (gCacheName->getGroupName(mFromID, group_name)) - { - from_string = LLTrans::getString("InvOfferAnObjectNamed") + " "+"'" - + mFromName + LLTrans::getString("'") +" " + LLTrans::getString("InvOfferOwnedByGroup") - + " "+ "'" + group_name + "'"; - - chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedByGroup") - + " " + group_name + "'"; - } - else - { - from_string = LLTrans::getString("InvOfferAnObjectNamed") + " "+"'" - + mFromName +"'"+ " " + LLTrans::getString("InvOfferOwnedByUnknownGroup"); - chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedByUnknownGroup"); - } - } - else - { - std::string first_name, last_name; - if (gCacheName->getName(mFromID, first_name, last_name)) - { - from_string = LLTrans::getString("InvOfferAnObjectNamed") + " "+ LLTrans::getString("'") + mFromName - + LLTrans::getString("'")+" " + LLTrans::getString("InvOfferOwnedBy") + first_name + " " + last_name; - chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedBy") + " " + first_name + " " + last_name; - } - else - { - from_string = LLTrans::getString("InvOfferAnObjectNamed") + " "+LLTrans::getString("'") - + mFromName + LLTrans::getString("'")+" " + LLTrans::getString("InvOfferOwnedByUnknownUser"); - chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedByUnknownUser"); - } - } - } - else - { - from_string = chatHistory_string = mFromName; - } + + // TODO: when task inventory offers can also be handled the new way, migrate the code that sets these strings here: + from_string = chatHistory_string = mFromName; bool busy=FALSE; @@ -1281,8 +1242,182 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& return false; } +bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const LLSD& response) +{ + LLChat chat; + std::string log_message; + S32 button = LLNotification::getSelectedOption(notification, response); + + // For muting, we need to add the mute, then decline the offer. + // This must be done here because: + // * callback may be called immediately, + // * adding the mute sends a message, + // * we can't build two messages at once. + if (2 == button) + { + gCacheName->get(mFromID, mFromGroup, &inventory_offer_mute_callback); + } + + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_ImprovedInstantMessage); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->nextBlockFast(_PREHASH_MessageBlock); + msg->addBOOLFast(_PREHASH_FromGroup, FALSE); + msg->addUUIDFast(_PREHASH_ToAgentID, mFromID); + msg->addU8Fast(_PREHASH_Offline, IM_ONLINE); + msg->addUUIDFast(_PREHASH_ID, mTransactionID); + msg->addU32Fast(_PREHASH_Timestamp, NO_TIMESTAMP); // no timestamp necessary + std::string name; + LLAgentUI::buildFullname(name); + msg->addStringFast(_PREHASH_FromAgentName, name); + msg->addStringFast(_PREHASH_Message, ""); + msg->addU32Fast(_PREHASH_ParentEstateID, 0); + msg->addUUIDFast(_PREHASH_RegionID, LLUUID::null); + msg->addVector3Fast(_PREHASH_Position, gAgent.getPositionAgent()); + LLInventoryObserver* opener = NULL; + LLViewerInventoryCategory* catp = NULL; + catp = (LLViewerInventoryCategory*)gInventory.getCategory(mObjectID); + LLViewerInventoryItem* itemp = NULL; + if(!catp) + { + itemp = (LLViewerInventoryItem*)gInventory.getItem(mObjectID); + } + + std::string from_string; // Used in the pop-up. + std::string chatHistory_string; // Used in chat history. + if (mFromObject == TRUE) + { + if (mFromGroup) + { + std::string group_name; + if (gCacheName->getGroupName(mFromID, group_name)) + { + from_string = LLTrans::getString("InvOfferAnObjectNamed") + " "+"'" + + mFromName + LLTrans::getString("'") +" " + LLTrans::getString("InvOfferOwnedByGroup") + + " "+ "'" + group_name + "'"; + + chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedByGroup") + + " " + group_name + "'"; + } + else + { + from_string = LLTrans::getString("InvOfferAnObjectNamed") + " "+"'" + + mFromName +"'"+ " " + LLTrans::getString("InvOfferOwnedByUnknownGroup"); + chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedByUnknownGroup"); + } + } + else + { + std::string first_name, last_name; + if (gCacheName->getName(mFromID, first_name, last_name)) + { + from_string = LLTrans::getString("InvOfferAnObjectNamed") + " "+ LLTrans::getString("'") + mFromName + + LLTrans::getString("'")+" " + LLTrans::getString("InvOfferOwnedBy") + first_name + " " + last_name; + chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedBy") + " " + first_name + " " + last_name; + } + else + { + from_string = LLTrans::getString("InvOfferAnObjectNamed") + " "+LLTrans::getString("'") + + mFromName + LLTrans::getString("'")+" " + LLTrans::getString("InvOfferOwnedByUnknownUser"); + chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedByUnknownUser"); + } + } + } + else + { + from_string = chatHistory_string = mFromName; + } + + bool busy=FALSE; + + switch(button) + { + case IOR_ACCEPT: + // ACCEPT. The math for the dialog works, because the accept + // for inventory_offered, task_inventory_offer or + // group_notice_inventory is 1 greater than the offer integer value. + // Generates IM_INVENTORY_ACCEPTED, IM_TASK_INVENTORY_ACCEPTED, + // or IM_GROUP_NOTICE_INVENTORY_ACCEPTED + msg->addU8Fast(_PREHASH_Dialog, (U8)(mIM + 1)); + msg->addBinaryDataFast(_PREHASH_BinaryBucket, &(mFolderID.mData), + sizeof(mFolderID.mData)); + // send the message + msg->sendReliable(mHost); + + //don't spam them if they are getting flooded + if (check_offer_throttle(mFromName, true)) + { + log_message = chatHistory_string + " " + LLTrans::getString("InvOfferGaveYou") + " " + mDesc + LLTrans::getString("."); + chat.mText = log_message; + LLFloaterChat::addChatHistory(chat); + } + + // we will want to open this item when it comes back. + LL_DEBUGS("Messaging") << "Initializing an opener for tid: " << mTransactionID + << LL_ENDL; + switch (mIM) + { + case IM_TASK_INVENTORY_OFFERED: + case IM_GROUP_NOTICE: + case IM_GROUP_NOTICE_REQUESTED: + { + // This is an offer from a task or group. + // We don't use a new instance of an opener + // We instead use the singular observer gOpenTaskOffer + // Since it already exists, we don't need to actually do anything + } + break; + default: + LL_WARNS("Messaging") << "inventory_offer_callback: unknown offer type" << LL_ENDL; + break; + } // end switch (mIM) + break; + + case IOR_BUSY: + //Busy falls through to decline. Says to make busy message. + busy=TRUE; + case IOR_MUTE: + // MUTE falls through to decline + case IOR_DECLINE: + // DECLINE. The math for the dialog works, because the decline + // for inventory_offered, task_inventory_offer or + // group_notice_inventory is 2 greater than the offer integer value. + // Generates IM_INVENTORY_DECLINED, IM_TASK_INVENTORY_DECLINED, + // or IM_GROUP_NOTICE_INVENTORY_DECLINED + default: + // close button probably (or any of the fall-throughs from above) + msg->addU8Fast(_PREHASH_Dialog, (U8)(mIM + 2)); + msg->addBinaryDataFast(_PREHASH_BinaryBucket, EMPTY_BINARY_BUCKET, EMPTY_BINARY_BUCKET_SIZE); + // send the message + msg->sendReliable(mHost); + + log_message = LLTrans::getString("InvOfferYouDecline") + " " + mDesc + " " + LLTrans::getString("InvOfferFrom") + " " + mFromName +"."; + chat.mText = log_message; + if( LLMuteList::getInstance()->isMuted(mFromID ) && ! LLMuteList::getInstance()->isLinden(mFromName) ) // muting for SL-42269 + { + chat.mMuted = TRUE; + } + LLFloaterChat::addChatHistory(chat); + + if (busy && (!mFromGroup && !mFromObject)) + { + busy_message(msg,mFromID); + } + break; + } + + if(opener) + { + gInventory.addObserver(opener); + } + + delete this; + return false; +} -void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) +void inventory_offer_handler(LLOfferInfo* info) { //Until throttling is implmented, busy mode should reject inventory instead of silently //accepting it. SEE SL-39554 @@ -1369,38 +1504,44 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) args["OBJECTFROMNAME"] = info->mFromName; args["NAME"] = info->mFromName; args["NAME_SLURL"] = LLSLURL::buildCommand("agent", info->mFromID, "about"); - std::string verb = "highlight?name=" + msg; + std::string verb = "select?name=" + msg; args["ITEM_SLURL"] = LLSLURL::buildCommand("inventory", info->mObjectID, verb.c_str()); LLNotification::Params p("ObjectGiveItem"); - p.substitutions(args).payload(payload).functor.function(boost::bind(&LLOfferInfo::inventory_offer_callback, info, _1, _2)); - if (from_task) + // Object -> Agent Inventory Offer + if (info->mFromObject) { + // Inventory Slurls don't currently work for non agent transfers, so only display the object name. + args["ITEM_SLURL"] = msg; + // Note: sets inventory_task_offer_callback as the callback + p.substitutions(args).payload(payload).functor.function(boost::bind(&LLOfferInfo::inventory_task_offer_callback, info, _1, _2)); p.name = name_found ? "ObjectGiveItem" : "ObjectGiveItemUnknownUser"; } - else + else // Agent -> Agent Inventory Offer { + // Note: sets inventory_offer_callback as the callback + p.substitutions(args).payload(payload).functor.function(boost::bind(&LLOfferInfo::inventory_offer_callback, info, _1, _2)); p.name = "UserGiveItem"; + + // Prefetch the item into your local inventory. + LLInventoryFetchObserver::item_ref_t items; + items.push_back(info->mObjectID); + LLInventoryFetchObserver* fetch_item = new LLInventoryFetchObserver(); + fetch_item->fetchItems(items); + if(fetch_item->isEverythingComplete()) + { + fetch_item->done(); + } + else + { + gInventory.addObserver(fetch_item); + } + + // In viewer 2 we're now auto receiving inventory offers and messaging as such (not sending reject messages). + info->send_auto_receive_response(); } - // Prefetch the item into your local inventory. - LLInventoryFetchObserver::item_ref_t items; - items.push_back(info->mObjectID); - LLInventoryFetchObserver* fetch_item = new LLInventoryFetchObserver(); - fetch_item->fetchItems(items); - if(fetch_item->isEverythingComplete()) - { - fetch_item->done(); - } - else - { - gInventory.addObserver(fetch_item); - } - - // 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); } @@ -1897,7 +2038,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } else { - inventory_offer_handler(info, dialog == IM_TASK_INVENTORY_OFFERED); + inventory_offer_handler(info); } } break; -- cgit v1.2.3