summaryrefslogtreecommitdiff
path: root/indra/newview/llnearbychat.cpp
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2009-11-17 16:36:22 +0200
committerVadim Savchuk <vsavchuk@productengine.com>2009-11-17 16:36:22 +0200
commit402e957c56113550e53a3892908c6c7a5c16783a (patch)
tree33cf9a73825392b2ed08d1de91c6bd4c0a28d83b /indra/newview/llnearbychat.cpp
parent53be27e742b642c1642c3289e3e11b300a14d360 (diff)
parent2217a677104ffadab8815a0886d66ac264e74792 (diff)
Merge from default branch.
Added missing trailing newline to fix Linux build. --HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llnearbychat.cpp')
-rw-r--r--indra/newview/llnearbychat.cpp32
1 files changed, 31 insertions, 1 deletions
diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp
index 6cac5385b6..f1cd8e558f 100644
--- a/indra/newview/llnearbychat.cpp
+++ b/indra/newview/llnearbychat.cpp
@@ -153,7 +153,37 @@ void LLNearbyChat::addMessage(const LLChat& chat)
if (!chat.mMuted)
{
- mChatHistory->appendWidgetMessage(chat);
+ std::string message = chat.mText;
+ std::string prefix = message.substr(0, 4);
+
+ if (chat.mChatStyle == CHAT_STYLE_IRC)
+ {
+ LLColor4 txt_color = LLUIColorTable::instance().getColor("White");
+ LLViewerChat::getChatColor(chat,txt_color);
+ LLFontGL* fontp = LLViewerChat::getChatFont();
+ std::string font_name = LLFontGL::nameFromFont(fontp);
+ std::string font_size = LLFontGL::sizeFromFont(fontp);
+ LLStyle::Params append_style_params;
+ append_style_params.color(txt_color);
+ append_style_params.readonly_color(txt_color);
+ append_style_params.font.name(font_name);
+ append_style_params.font.size(font_size);
+ if (chat.mFromName.size() > 0)
+ {
+ append_style_params.font.style = "ITALIC";
+ LLChat add_chat=chat;
+ add_chat.mText = chat.mFromName + " ";
+ mChatHistory->appendWidgetMessage(add_chat, append_style_params);
+ }
+
+ message = message.substr(3);
+ append_style_params.font.style = "UNDERLINE";
+ mChatHistory->appendText(message, FALSE, append_style_params);
+ }
+ else
+ {
+ mChatHistory->appendWidgetMessage(chat);
+ }
}
}