diff options
Diffstat (limited to 'indra/newview/llviewerchat.cpp')
-rw-r--r-- | indra/newview/llviewerchat.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/indra/newview/llviewerchat.cpp b/indra/newview/llviewerchat.cpp index 597cf3c98c..2ca2c5c07d 100644 --- a/indra/newview/llviewerchat.cpp +++ b/indra/newview/llviewerchat.cpp @@ -36,12 +36,13 @@ #include "llviewerregion.h" #include "llworld.h" #include "llinstantmessage.h" //SYSTEM_FROM +#include "llurlregistry.h" // LLViewerChat LLViewerChat::font_change_signal_t LLViewerChat::sChatFontChangedSignal; //static -void LLViewerChat::getChatColor(const LLChat& chat, LLColor4& r_color) +void LLViewerChat::getChatColor(const LLChat& chat, LLUIColor& r_color, F32& r_color_alpha) { if(chat.mMuted) { @@ -90,7 +91,7 @@ void LLViewerChat::getChatColor(const LLChat& chat, LLColor4& r_color) } break; default: - r_color.setToWhite(); + r_color = LLUIColorTable::instance().getColor("White"); } if (!chat.mPosAgent.isExactlyZero()) @@ -101,7 +102,11 @@ void LLViewerChat::getChatColor(const LLChat& chat, LLColor4& r_color) if (distance_squared > dist_near_chat * dist_near_chat) { // diminish far-off chat - r_color.mV[VALPHA] = 0.8f; + r_color_alpha = 0.8f; + } + else + { + r_color_alpha = 1.0f; } } } @@ -218,6 +223,13 @@ void LLViewerChat::formatChatMsg(const LLChat& chat, std::string& formated_msg) { std::string tmpmsg = chat.mText; + // show @name instead of slurl for chat mentions + LLUrlMatch match; + while (LLUrlRegistry::instance().findUrl(tmpmsg, match, LLUrlRegistryNullCallback, false, true)) + { + tmpmsg.replace(match.getStart(), match.getEnd() - match.getStart() + 1, match.getLabel()); + } + if(chat.mChatStyle == CHAT_STYLE_IRC) { formated_msg = chat.mFromName + tmpmsg.substr(3); |