summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/lltextbase.cpp2
-rw-r--r--indra/newview/llchatitemscontainerctrl.cpp59
2 files changed, 55 insertions, 6 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 9adeddca99..758df418e8 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -1622,7 +1622,7 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para
style_params.fillFrom(getDefaultStyleParams());
S32 part = (S32)LLTextParser::WHOLE;
- if(mParseHTML)
+ if (mParseHTML && !style_params.is_link) // Don't search for URLs inside a link segment (STORM-358).
{
S32 start=0,end=0;
LLUrlMatch match;
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