diff options
Diffstat (limited to 'indra/newview/llchathistory.cpp')
-rw-r--r-- | indra/newview/llchathistory.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 81cc52528c..cf5ac6b2e6 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -122,7 +122,7 @@ public: BOOL handleToolTip(S32 x, S32 y, MASK mask) { LLTextBase* name = getChild<LLTextBase>("user_name"); - if (name && name->parentPointInView(x, y) && mAvatarID.notNull() && SYSTEM_FROM != mFrom) + if (name && name->parentPointInView(x, y) && mAvatarID.notNull() && mFrom.size() && SYSTEM_FROM != mFrom) { // Spawn at right side of the name textbox. @@ -179,12 +179,7 @@ public: } else if (level == "add") { - std::string name; - name.assign(getFirstName()); - name.append(" "); - name.append(getLastName()); - - LLAvatarActions::requestFriendshipDialog(getAvatarId(), name); + LLAvatarActions::requestFriendshipDialog(getAvatarId(), mFrom); } else if (level == "remove") { @@ -253,8 +248,6 @@ public: } const LLUUID& getAvatarId () const { return mAvatarID;} - const std::string& getFirstName() const { return mFirstName; } - const std::string& getLastName () const { return mLastName; } void setup(const LLChat& chat,const LLStyle::Params& style_params) { @@ -264,7 +257,7 @@ public: gCacheName->get(mAvatarID, FALSE, boost::bind(&LLChatHistoryHeader::nameUpdatedCallback, this, _1, _2, _3, _4)); //*TODO overly defensive thing, source type should be maintained out there - if(chat.mFromID.isNull() || chat.mFromName == SYSTEM_FROM) + if((chat.mFromID.isNull() && chat.mFromName.empty()) || chat.mFromName == SYSTEM_FROM) { mSourceType = CHAT_SOURCE_SYSTEM; } @@ -275,9 +268,11 @@ public: userName->setColor(style_params.color()); userName->setValue(chat.mFromName); + mFrom = chat.mFromName; if (chat.mFromName.empty() || CHAT_SOURCE_SYSTEM == mSourceType) { - userName->setValue(LLTrans::getString("SECOND_LIFE")); + mFrom = LLTrans::getString("SECOND_LIFE"); + userName->setValue(mFrom); } @@ -337,8 +332,7 @@ public: { if (id != mAvatarID) return; - mFirstName = first; - mLastName = last; + mFrom = first + " " + last; } protected: static const S32 PADDING = 20; @@ -423,8 +417,6 @@ protected: LLUUID mAvatarID; EChatSourceType mSourceType; - std::string mFirstName; - std::string mLastName; std::string mFrom; LLUUID mSessionID; @@ -796,6 +788,12 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL } } + if (irc_me && !use_plain_text_chat_history) + { + message = chat.mFromName + message; + } + + mEditor->appendText(message, FALSE, style_params); } mEditor->blockUndo(); |