merge changes for storm-1078

meow-7.2.2
Oz Linden 2011-03-15 12:34:41 -04:00
commit 93620a1dc8
3 changed files with 6942 additions and 6920 deletions

View File

@ -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

View File

@ -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();

File diff suppressed because it is too large Load Diff