diff options
author | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-03-11 18:20:24 +0200 |
---|---|---|
committer | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-03-11 18:20:24 +0200 |
commit | 845405cce6e432c60f1733e7b8d529682a107a86 (patch) | |
tree | 31ccc28d5a3bfd1547b6628a9db45905dc229d7c /indra | |
parent | 1426765e82549ec9d17a0f90d902f25c0e785bbd (diff) |
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).
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llchathistory.cpp | 43 | ||||
-rw-r--r-- | 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<LLAvatarIconCtrl>("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(); |