summaryrefslogtreecommitdiff
path: root/indra/newview/llnearbychat.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2009-10-01 17:44:44 +0000
committerSteven Bennetts <steve@lindenlab.com>2009-10-01 17:44:44 +0000
commitf05df68656d2abdc38d86cd6746398fa90eb8614 (patch)
tree95f389551a7132b86dd96ff7c55b92674ee16756 /indra/newview/llnearbychat.cpp
parent090977608d3d4e1d6d26689064910221c66f6084 (diff)
merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0@1868 https://svn.aws.productengine.com/secondlife/pe/stable-2@1876 -> viewer-2.0.0-3
* Bugs: EXT-1111 EXT-915 EXT-1131 EXT-1200 EXT-1202 EXT-1201 EXT-1205 EXT-1212 EXT-1173 EXT-1229 EXT-1218 EXT-1164 EXT-996 EXT-821 EXT-1030 EXT-1031 EXT-816 * Major Bugs: EXT-1142 (timeout during login due to processing group IMs) * Changes: EXT-1216 (minimize message well)
Diffstat (limited to 'indra/newview/llnearbychat.cpp')
-rw-r--r--indra/newview/llnearbychat.cpp29
1 files changed, 19 insertions, 10 deletions
diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp
index b53bb586f3..8430937933 100644
--- a/indra/newview/llnearbychat.cpp
+++ b/indra/newview/llnearbychat.cpp
@@ -65,6 +65,7 @@ LLNearbyChat::LLNearbyChat(const LLSD& key) :
mChatCaptionPanel(NULL),
mChatHistoryEditor(NULL)
{
+ m_isDirty = false;
}
LLNearbyChat::~LLNearbyChat()
@@ -181,7 +182,7 @@ LLColor4 nearbychat_get_text_color(const LLChat& chat)
return text_color;
}
-void nearbychat_add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4& color)
+void LLNearbyChat::add_timestamped_line(const LLChat& chat, const LLColor4& color)
{
std::string line = chat.mText;
@@ -194,25 +195,28 @@ void nearbychat_add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, cons
bool prepend_newline = true;
if (gSavedSettings.getBOOL("ChatShowTimestamps"))
{
- edit->appendTime(prepend_newline);
+ mChatHistoryEditor->appendTime(prepend_newline);
prepend_newline = false;
}
// If the msg is from an agent (not yourself though),
// extract out the sender name and replace it with the hotlinked name.
+
+ std::string str_URL = chat.mURL;
+
if (chat.mSourceType == CHAT_SOURCE_AGENT &&
chat.mFromID != LLUUID::null)
{
- chat.mURL = llformat("secondlife:///app/agent/%s/about",chat.mFromID.asString().c_str());
+ str_URL = llformat("secondlife:///app/agent/%s/about",chat.mFromID.asString().c_str());
}
// If the chat line has an associated url, link it up to the name.
- if (!chat.mURL.empty()
+ if (!str_URL.empty()
&& (line.length() > chat.mFromName.length() && line.find(chat.mFromName,0) == 0))
{
std::string start_line = line.substr(0, chat.mFromName.length() + 1);
line = line.substr(chat.mFromName.length() + 1);
- edit->appendStyledText(start_line, false, prepend_newline, LLStyleMap::instance().lookup(chat.mFromID,chat.mURL));
+ mChatHistoryEditor->appendStyledText(start_line, false, prepend_newline, LLStyleMap::instance().lookup(chat.mFromID,str_URL));
prepend_newline = false;
}
@@ -225,11 +229,9 @@ void nearbychat_add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, cons
else if (2 == font_size)
font_name = "sansserifbig";
- edit->appendColoredText(line, false, prepend_newline, color, font_name);
+ mChatHistoryEditor->appendColoredText(line, false, prepend_newline, color, font_name);
}
-
-
void LLNearbyChat::addMessage(const LLChat& chat)
{
LLColor4 color = nearbychat_get_text_color(chat);
@@ -254,7 +256,7 @@ void LLNearbyChat::addMessage(const LLChat& chat)
mChatHistoryEditor->setParseHighlights(TRUE);
if (!chat.mMuted)
- nearbychat_add_timestamped_line(mChatHistoryEditor, chat, color);
+ add_timestamped_line(chat, color);
}
void LLNearbyChat::onNearbySpeakers()
@@ -482,9 +484,16 @@ BOOL LLNearbyChat::handleRightMouseDown(S32 x, S32 y, MASK mask)
void LLNearbyChat::onOpen(const LLSD& key )
{
- LLNotificationsUI::LLScreenChannel* chat_channel = LLNotificationsUI::LLChannelManager::getInstance()->findChannelByID(LLUUID(gSavedSettings.getString("NearByChatChannelUUID")));
+ LLNotificationsUI::LLScreenChannelBase* chat_channel = LLNotificationsUI::LLChannelManager::getInstance()->findChannelByID(LLUUID(gSavedSettings.getString("NearByChatChannelUUID")));
if(chat_channel)
{
chat_channel->removeToastsFromChannel();
}
}
+
+void LLNearbyChat::draw ()
+{
+ LLFloater::draw();
+}
+
+