summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorVadim ProductEngine <vsavchuk@productengine.com>2010-10-19 19:55:19 +0300
committerVadim ProductEngine <vsavchuk@productengine.com>2010-10-19 19:55:19 +0300
commitd97355a19f3b88512105965cfd752956f0230b41 (patch)
treec95f1b6a700eb08911257b90003e0e6c0380c54f /indra/newview
parentc683151587067cb2758206432610d4ff4884036e (diff)
STORM-390 FIXED "Place Profile" appeared instead of "Resident Profile" after clicking on user name in a nearby chat toast.
Now clicking an avatar name opens avatar profile; clicking an object name opens object inspector. This change rolls back the fix of STORM-358.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llchatitemscontainerctrl.cpp59
1 files changed, 54 insertions, 5 deletions
diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp
index ababa71348..d353c809ca 100644
--- a/indra/newview/llchatitemscontainerctrl.cpp
+++ b/indra/newview/llchatitemscontainerctrl.cpp
@@ -31,6 +31,7 @@
#include "llchatmsgbox.h"
#include "llavatariconctrl.h"
+#include "llcommandhandler.h"
#include "llfloaterreg.h"
#include "lllocalcliprect.h"
#include "lltrans.h"
@@ -45,6 +46,40 @@ static const S32 msg_right_offset = 10;
static const S32 msg_height_pad = 5;
//*******************************************************************************************************************
+// LLObjectHandler
+//*******************************************************************************************************************
+
+// handle secondlife:///app/object/<ID>/inspect SLURLs
+class LLObjectHandler : public LLCommandHandler
+{
+public:
+ LLObjectHandler() : LLCommandHandler("object", UNTRUSTED_BLOCK) { }
+
+ bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web)
+ {
+ if (params.size() < 2) return false;
+
+ LLUUID object_id;
+ if (!object_id.set(params[0], FALSE))
+ {
+ return false;
+ }
+
+ const std::string verb = params[1].asString();
+
+ if (verb == "inspect")
+ {
+ LLFloaterReg::showInstance("inspect_object", LLSD().with("object_id", object_id));
+ return true;
+ }
+
+ return false;
+ }
+};
+
+LLObjectHandler gObjectHandler;
+
+//*******************************************************************************************************************
//LLNearbyChatToastPanel
//*******************************************************************************************************************
@@ -169,17 +204,26 @@ void LLNearbyChatToastPanel::init(LLSD& notification)
{
std::string str_sender;
- str_sender = "<nolink>"; // disable parsing URLs in object names (STORM-358)
- str_sender += fromName;
- str_sender += "</nolink>";
+ str_sender = fromName;
str_sender+=" ";
- //append user name
+ //append sender name
+ if (mSourceType == CHAT_SOURCE_AGENT || mSourceType == CHAT_SOURCE_OBJECT)
{
LLStyle::Params style_params_name;
LLColor4 userNameColor = LLUIColorTable::instance().getColor("ChatToastAgentNameColor");
+ std::string href;
+
+ if (mSourceType == CHAT_SOURCE_AGENT)
+ {
+ href = LLSLURL("agent", mFromID, "about").getSLURLString();
+ }
+ else
+ {
+ href = LLSLURL("object", mFromID, "inspect").getSLURLString();
+ }
style_params_name.color(userNameColor);
@@ -188,11 +232,16 @@ void LLNearbyChatToastPanel::init(LLSD& notification)
style_params_name.font.name(font_name);
style_params_name.font.size(font_style_size);
- style_params_name.link_href = LLSLURL("agent",mFromID,"about").getSLURLString();
+ style_params_name.link_href = href;
+ style_params_name.is_link = true;
msg_text->appendText(str_sender, FALSE, style_params_name);
}
+ else
+ {
+ msg_text->appendText(str_sender, false);
+ }
}
//append text