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