From 254b7d72d17c279aa906ee235f08ff1fa9e2b9cf Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Mon, 25 Jan 2010 18:43:31 +0200 Subject: fixed EXT-4601 [BSI] New IM sessions use obsolete timestamps for first message --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index a46cd84b60..d6a7edee5b 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -550,8 +550,8 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ if (mLastFromName == chat.mFromName && mLastFromID == chat.mFromID && mLastMessageTime.notNull() - && (new_message_time.secondsSinceEpoch() - mLastMessageTime.secondsSinceEpoch()) < 60.0 - ) + && (new_message_time.secondsSinceEpoch() - mLastMessageTime.secondsSinceEpoch()) < 60.0 + && mLastMessageTimeStr.size() == chat.mTimeStr.size()) //*HACK to distinguish between current and previous chat session's histories { view = getSeparator(); p.top_pad = mTopSeparatorPad; @@ -585,6 +585,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ mLastFromName = chat.mFromName; mLastFromID = chat.mFromID; mLastMessageTime = new_message_time; + mLastMessageTimeStr = chat.mTimeStr; } std::string message = irc_me ? chat.mText.substr(3) : chat.mText; -- cgit v1.2.3 From d002c705b7b1772194b78f8c405e3907e76f445c Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Thu, 28 Jan 2010 11:10:10 +0000 Subject: EXT-4693: First steps at using remote inspector. Now Object IMs that get sent to your local chat window will have secondlife:///app/objectim SLapps, which will open the remote object inspector for that object, not the avatar inspector. However, we don't have all the information needed for the remote object inspector, so I'm going to have to investigate extending the inspector to request the missing information from the server. --- indra/newview/llchathistory.cpp | 46 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) (limited to 'indra/newview/llchathistory.cpp') 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 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)); -- cgit v1.2.3 From f6fceac081a1f2d165679ce3eb233e97806cebe7 Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Thu, 28 Jan 2010 15:51:49 +0200 Subject: fixed EXT-3841 [BSI] "Send IM..." choosable in IM floater context menu --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index d6a7edee5b..2cdbd18996 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -34,6 +34,7 @@ #include "llinstantmessage.h" +#include "llimview.h" #include "llchathistory.h" #include "llpanel.h" #include "lluictrlfactory.h" @@ -183,6 +184,7 @@ public: void setup(const LLChat& chat,const LLStyle::Params& style_params) { mAvatarID = chat.mFromID; + mSessionID = chat.mSessionID; mSourceType = chat.mSourceType; gCacheName->get(mAvatarID, FALSE, boost::bind(&LLChatHistoryHeader::nameUpdatedCallback, this, _1, _2, _3, _4)); if(chat.mFromID.isNull()) @@ -305,6 +307,11 @@ protected: menu->setItemEnabled("Remove Friend", false); } + if (mSessionID == LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, mAvatarID)) + { + menu->setItemVisible("Send IM", false); + } + menu->buildDrawLabels(); menu->updateParent(LLMenuGL::sMenuContainer); LLMenuGL::showPopup(this, menu, x, y); @@ -344,6 +351,7 @@ protected: std::string mFirstName; std::string mLastName; std::string mFrom; + LLUUID mSessionID; S32 mMinUserNameWidth; }; -- cgit v1.2.3 From fee014bd82cd78f07bcc88c45109a1ea2b2eee24 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Thu, 28 Jan 2010 15:38:55 +0000 Subject: EXT-4693: Pass through owner ID to remote object inspector. Plumbing to pass the owner ID for a chatting object down into the LLChatHistory::appendMessage() method where we create the objectim SLapp that will bring up the remote object inspector. Pheww. For object notifications that are displayed as text chat, we --- indra/newview/llchathistory.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index fd438001e1..dd9f0c2ebe 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -50,6 +50,8 @@ #include "llslurl.h" #include "lllayoutstack.h" #include "llagent.h" +#include "llviewerregion.h" +#include "llworld.h" #include "llsidetray.h"//for blocked objects panel @@ -491,8 +493,9 @@ void LLChatHistory::clear() mLastFromID = LLUUID::null; } -void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_chat_history, const LLStyle::Params& input_append_params) +void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LLStyle::Params& input_append_params) { + bool use_plain_text_chat_history = args["use_plain_text_chat_history"].asBoolean(); if (!mEditor->scrolledToEnd() && chat.mFromID != gAgent.getID() && !chat.mFromName.empty()) { mUnreadChatSources.insert(chat.mFromName); @@ -560,9 +563,20 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ // Don't hotlink any messages from the system (e.g. "Second Life:"), so just add those in plain text. if ( chat.mSourceType == CHAT_SOURCE_OBJECT ) { + // for object IMs, create a secondlife:///app/objectim SLapp std::string url = LLSLURL::buildCommand("objectim", chat.mFromID, ""); url += "?name=" + chat.mFromName; + url += "&owner=" + args["owner_id"].asString(); + LLViewerRegion *region = LLWorld::getInstance()->getRegionFromPosAgent(chat.mPosAgent); + if (region) + { + S32 x, y, z; + LLSLURL::globalPosToXYZ(LLVector3d(chat.mPosAgent), x, y, z); + url += "&slurl=" + region->getName() + llformat("/%d/%d/%d", x, y, z); + } + + // set the link for the object name to be the objectim SLapp LLStyle::Params link_params(style_params); link_params.color.control = "HTMLLinkColor"; link_params.link_href = url; -- cgit v1.2.3