Skip to content
Snippets Groups Projects
Commit 4edb3b57 authored by Oz Linden's avatar Oz Linden
Browse files

merge build fixes from viewer-social

parents 2c228638 93620a1d
No related branches found
No related tags found
No related merge requests found
...@@ -138,10 +138,7 @@ class LLChatHistoryHeader: public LLPanel ...@@ -138,10 +138,7 @@ class LLChatHistoryHeader: public LLPanel
if (level == "profile") if (level == "profile")
{ {
LLSD params; LLFloaterReg::showInstance("inspect_remote_object", mObjectData);
params["object_id"] = getAvatarId();
LLFloaterReg::showInstance("inspect_object", params);
} }
else if (level == "block") else if (level == "block")
{ {
...@@ -229,7 +226,7 @@ class LLChatHistoryHeader: public LLPanel ...@@ -229,7 +226,7 @@ class LLChatHistoryHeader: public LLPanel
if (mSourceType == CHAT_SOURCE_OBJECT) 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) else if (mSourceType == CHAT_SOURCE_AGENT)
{ {
...@@ -251,7 +248,7 @@ class LLChatHistoryHeader: public LLPanel ...@@ -251,7 +248,7 @@ class LLChatHistoryHeader: public LLPanel
const LLUUID& getAvatarId () const { return mAvatarID;} 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; mAvatarID = chat.mFromID;
mSessionID = chat.mSessionID; mSessionID = chat.mSessionID;
...@@ -332,7 +329,8 @@ class LLChatHistoryHeader: public LLPanel ...@@ -332,7 +329,8 @@ class LLChatHistoryHeader: public LLPanel
setTimeField(chat); setTimeField(chat);
// Set up the icon.
LLAvatarIconCtrl* icon = getChild<LLAvatarIconCtrl>("avatar_icon"); LLAvatarIconCtrl* icon = getChild<LLAvatarIconCtrl>("avatar_icon");
if(mSourceType != CHAT_SOURCE_AGENT || mAvatarID.isNull()) if(mSourceType != CHAT_SOURCE_AGENT || mAvatarID.isNull())
...@@ -352,6 +350,30 @@ class LLChatHistoryHeader: public LLPanel ...@@ -352,6 +350,30 @@ class LLChatHistoryHeader: public LLPanel
case CHAT_SOURCE_UNKNOWN: case CHAT_SOURCE_UNKNOWN:
icon->setValue(LLSD("Unknown_Icon")); 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() /*virtual*/ void draw()
...@@ -540,6 +562,7 @@ class LLChatHistoryHeader: public LLPanel ...@@ -540,6 +562,7 @@ class LLChatHistoryHeader: public LLPanel
static LLUICtrl* sInfoCtrl; static LLUICtrl* sInfoCtrl;
LLUUID mAvatarID; LLUUID mAvatarID;
LLSD mObjectData;
EChatSourceType mSourceType; EChatSourceType mSourceType;
std::string mFrom; std::string mFrom;
LLUUID mSessionID; LLUUID mSessionID;
...@@ -649,10 +672,10 @@ LLView* LLChatHistory::getSeparator() ...@@ -649,10 +672,10 @@ LLView* LLChatHistory::getSeparator()
return separator; 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); LLChatHistoryHeader* header = LLChatHistoryHeader::createInstance(mMessageHeaderFilename);
header->setup(chat,style_params); header->setup(chat, style_params, args);
return header; return header;
} }
...@@ -834,7 +857,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL ...@@ -834,7 +857,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
} }
else else
{ {
view = getHeader(chat, style_params); view = getHeader(chat, style_params, args);
if (mEditor->getText().size() == 0) if (mEditor->getText().size() == 0)
p.top_pad = 0; p.top_pad = 0;
else else
......
...@@ -94,7 +94,7 @@ class LLChatHistory : public LLUICtrl ...@@ -94,7 +94,7 @@ class LLChatHistory : public LLUICtrl
* Builds a message header. * Builds a message header.
* @return pointer to LLView header object. * @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(); void onClickMoreText();
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment