diff options
author | Lynx Linden <lynx@lindenlab.com> | 2010-01-28 11:10:26 +0000 |
---|---|---|
committer | Lynx Linden <lynx@lindenlab.com> | 2010-01-28 11:10:26 +0000 |
commit | 8d4c36dd8251a98551137f912ec9dcc905549ab5 (patch) | |
tree | 2b92886d2cece1341a4378d074c895fe9d35d3f0 /indra/newview | |
parent | 52bd13e1f5cd661ff359e36be8c0496d06c19d1c (diff) | |
parent | d002c705b7b1772194b78f8c405e3907e76f445c (diff) |
Automated merge with ssh://hg.lindenlab.com/viewer/viewer-2-0/
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llchathistory.cpp | 46 | ||||
-rw-r--r-- | indra/newview/llviewermessage.cpp | 2 |
2 files changed, 46 insertions, 2 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index d6a7edee5b..fd438001e1 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -35,6 +35,7 @@ #include "llinstantmessage.h" #include "llchathistory.h" +#include "llcommandhandler.h" #include "llpanel.h" #include "lluictrlfactory.h" #include "llscrollcontainer.h" @@ -46,6 +47,7 @@ #include "llfloaterreg.h" #include "llmutelist.h" #include "llstylemap.h" +#include "llslurl.h" #include "lllayoutstack.h" #include "llagent.h" @@ -55,6 +57,38 @@ static LLDefaultChildRegistry::Register<LLChatHistory> r("chat_history"); const static std::string NEW_LINE(rawstr_to_utf8("\n")); +// support for secondlife:///app/objectim/{UUID}/ SLapps +class LLObjectIMHandler : public LLCommandHandler +{ +public: + // requests will be throttled from a non-trusted browser + LLObjectIMHandler() : LLCommandHandler("objectim", UNTRUSTED_THROTTLE) {} + + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + { + if (params.size() < 1) + { + return false; + } + + LLUUID object_id; + if (!object_id.set(params[0], FALSE)) + { + return false; + } + + LLSD payload; + payload["object_id"] = object_id; + payload["owner_id"] = query_map["owner"]; + payload["name"] = query_map["name"]; + payload["slurl"] = query_map["slurl"]; + payload["group_owned"] = query_map["groupowned"]; + LLFloaterReg::showInstance("inspect_remote_object", payload); + return true; + } +}; +LLObjectIMHandler gObjectIMHandler; + class LLChatHistoryHeader: public LLPanel { public: @@ -524,7 +558,17 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ if (utf8str_trim(chat.mFromName).size() != 0) { // Don't hotlink any messages from the system (e.g. "Second Life:"), so just add those in plain text. - if ( chat.mFromName != SYSTEM_FROM && chat.mFromID.notNull() ) + if ( chat.mSourceType == CHAT_SOURCE_OBJECT ) + { + std::string url = LLSLURL::buildCommand("objectim", chat.mFromID, ""); + url += "?name=" + chat.mFromName; + + LLStyle::Params link_params(style_params); + link_params.color.control = "HTMLLinkColor"; + link_params.link_href = url; + mEditor->appendText(chat.mFromName + delimiter, false, link_params); + } + else if ( chat.mFromName != SYSTEM_FROM && chat.mFromID.notNull() ) { LLStyle::Params link_params(style_params); link_params.fillFrom(LLStyleMap::instance().lookupAgent(chat.mFromID)); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index aa77c9602f..43c30b4c52 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2243,7 +2243,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) payload["SESSION_NAME"] = session_name; if (from_group) { - payload["groupowned"] = "true"; + payload["group_owned"] = "true"; } LLNotificationsUtil::add("ServerObjectMessage", substitutions, payload); } |