From 174b537953b5a39702c833ab1e83313a80e5e549 Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Wed, 9 Mar 2011 23:01:58 +0200 Subject: STORM-28 ADDITIONAL FIX Pressing "Show" button in the offer notification opens Inventory SP and selects the received calling card. --- indra/newview/llviewermessage.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 947408f125..68807a6e65 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1199,7 +1199,6 @@ void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_nam // Highlight item const BOOL auto_open = gSavedSettings.getBOOL("ShowInInventory") && // don't open if showininventory is false - !(asset_type == LLAssetType::AT_CALLINGCARD) && // don't open if it's a calling card !from_name.empty(); // don't open if it's not from anyone. LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(auto_open); if(active_panel) -- cgit v1.2.3 From 845405cce6e432c60f1733e7b8d529682a107a86 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Fri, 11 Mar 2011 18:20:24 +0200 Subject: STORM-1021 FIXED Viewer shows "L$300" instead of object IM details if object sends an IM from another region. The problem was caused by trying to lookup info for a *remote* object by its id in the gObjectList -- this is what the usual object inspector (LLInspectObject) does. The fix saves the sender object info when a message arrives, then passes the info to the remote object inspector (LLInspectRemoteObject). --- indra/newview/llchathistory.cpp | 43 +++++++++++++++++++++++++++++++---------- indra/newview/llchathistory.h | 2 +- 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 5ff22f89ab..d4ec377e03 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -138,10 +138,7 @@ public: if (level == "profile") { - LLSD params; - params["object_id"] = getAvatarId(); - - LLFloaterReg::showInstance("inspect_object", params); + LLFloaterReg::showInstance("inspect_remote_object", mObjectData); } else if (level == "block") { @@ -229,7 +226,7 @@ public: if (mSourceType == CHAT_SOURCE_OBJECT) { - LLFloaterReg::showInstance("inspect_object", LLSD().with("object_id", mAvatarID)); + LLFloaterReg::showInstance("inspect_remote_object", mObjectData); } else if (mSourceType == CHAT_SOURCE_AGENT) { @@ -251,7 +248,7 @@ public: const LLUUID& getAvatarId () const { return mAvatarID;} - void setup(const LLChat& chat,const LLStyle::Params& style_params) + void setup(const LLChat& chat, const LLStyle::Params& style_params, const LLSD& args) { mAvatarID = chat.mFromID; mSessionID = chat.mSessionID; @@ -332,7 +329,8 @@ public: setTimeField(chat); - + + // Set up the icon. LLAvatarIconCtrl* icon = getChild("avatar_icon"); if(mSourceType != CHAT_SOURCE_AGENT || mAvatarID.isNull()) @@ -352,6 +350,30 @@ public: case CHAT_SOURCE_UNKNOWN: icon->setValue(LLSD("Unknown_Icon")); } + + // In case the message came from an object, save the object info + // to be able properly show its profile. + if ( chat.mSourceType == CHAT_SOURCE_OBJECT) + { + std::string slurl = args["slurl"].asString(); + if (slurl.empty()) + { + LLViewerRegion *region = LLWorld::getInstance()->getRegionFromPosAgent(chat.mPosAgent); + if(region) + { + LLSLURL region_slurl(region->getName(), chat.mPosAgent); + slurl = region_slurl.getLocationString(); + } + } + + LLSD payload; + payload["object_id"] = chat.mFromID; + payload["name"] = chat.mFromName; + payload["owner_id"] = chat.mOwnerID; + payload["slurl"] = LLWeb::escapeURL(slurl); + + mObjectData = payload; + } } /*virtual*/ void draw() @@ -540,6 +562,7 @@ protected: static LLUICtrl* sInfoCtrl; LLUUID mAvatarID; + LLSD mObjectData; EChatSourceType mSourceType; std::string mFrom; LLUUID mSessionID; @@ -649,10 +672,10 @@ LLView* LLChatHistory::getSeparator() return separator; } -LLView* LLChatHistory::getHeader(const LLChat& chat,const LLStyle::Params& style_params) +LLView* LLChatHistory::getHeader(const LLChat& chat,const LLStyle::Params& style_params, const LLSD& args) { LLChatHistoryHeader* header = LLChatHistoryHeader::createInstance(mMessageHeaderFilename); - header->setup(chat,style_params); + header->setup(chat, style_params, args); return header; } @@ -834,7 +857,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL } else { - view = getHeader(chat, style_params); + view = getHeader(chat, style_params, args); if (mEditor->getText().size() == 0) p.top_pad = 0; else diff --git a/indra/newview/llchathistory.h b/indra/newview/llchathistory.h index ac48d7bf29..28344e6a10 100644 --- a/indra/newview/llchathistory.h +++ b/indra/newview/llchathistory.h @@ -94,7 +94,7 @@ class LLChatHistory : public LLUICtrl * Builds a message header. * @return pointer to LLView header object. */ - LLView* getHeader(const LLChat& chat,const LLStyle::Params& style_params); + LLView* getHeader(const LLChat& chat,const LLStyle::Params& style_params, const LLSD& args); void onClickMoreText(); -- cgit v1.2.3