summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
authorLynx Linden <lynx@lindenlab.com>2009-11-12 12:36:30 +0000
committerLynx Linden <lynx@lindenlab.com>2009-11-12 12:36:30 +0000
commit393f68c1a9785b29adc210124e342af24937d5f5 (patch)
tree0acb4a3ab4cc04d4854145251e61c04bc71a52f0 /indra/newview/llviewermessage.cpp
parent6b14f9a48f18842e207013d89e4578a73ee5e7bf (diff)
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.
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rw-r--r--indra/newview/llviewermessage.cpp28
1 files changed, 27 insertions, 1 deletions
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: