diff options
Diffstat (limited to 'linden/indra/newview/llfloaterchat.cpp')
-rw-r--r-- | linden/indra/newview/llfloaterchat.cpp | 104 |
1 files changed, 97 insertions, 7 deletions
diff --git a/linden/indra/newview/llfloaterchat.cpp b/linden/indra/newview/llfloaterchat.cpp index 5117b8d..1f51a21 100644 --- a/linden/indra/newview/llfloaterchat.cpp +++ b/linden/indra/newview/llfloaterchat.cpp | |||
@@ -56,10 +56,11 @@ | |||
56 | #include "llfloaterchatterbox.h" | 56 | #include "llfloaterchatterbox.h" |
57 | #include "llfloatermute.h" | 57 | #include "llfloatermute.h" |
58 | #include "llkeyboard.h" | 58 | #include "llkeyboard.h" |
59 | //#include "lllineeditor.h" | 59 | #include "lllineeditor.h" |
60 | #include "llmutelist.h" | 60 | #include "llmutelist.h" |
61 | //#include "llresizehandle.h" | 61 | //#include "llresizehandle.h" |
62 | #include "llchatbar.h" | 62 | #include "llchatbar.h" |
63 | #include "llspinctrl.h" | ||
63 | #include "llstatusbar.h" | 64 | #include "llstatusbar.h" |
64 | #include "llviewertexteditor.h" | 65 | #include "llviewertexteditor.h" |
65 | #include "llviewergesture.h" // for triggering gestures | 66 | #include "llviewergesture.h" // for triggering gestures |
@@ -188,7 +189,7 @@ void LLFloaterChat::updateConsoleVisibility() | |||
188 | || (getHost() && getHost()->isMinimized() )); // are we hosted in a minimized floater? | 189 | || (getHost() && getHost()->isMinimized() )); // are we hosted in a minimized floater? |
189 | } | 190 | } |
190 | 191 | ||
191 | void add_timestamped_line(LLViewerTextEditor* edit, const LLChat &chat, const LLColor4& color) | 192 | void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4& color) |
192 | { | 193 | { |
193 | std::string line = chat.mText; | 194 | std::string line = chat.mText; |
194 | bool prepend_newline = true; | 195 | bool prepend_newline = true; |
@@ -198,16 +199,25 @@ void add_timestamped_line(LLViewerTextEditor* edit, const LLChat &chat, const LL | |||
198 | prepend_newline = false; | 199 | prepend_newline = false; |
199 | } | 200 | } |
200 | 201 | ||
201 | // If the msg is not from an agent (not yourself though), | 202 | // If the msg is from an agent (not yourself though), |
202 | // extract out the sender name and replace it with the hotlinked name. | 203 | // extract out the sender name and replace it with the hotlinked name. |
203 | if (chat.mSourceType == CHAT_SOURCE_AGENT && | 204 | if (chat.mSourceType == CHAT_SOURCE_AGENT && |
204 | chat.mFromID != LLUUID::null && | 205 | chat.mFromID != LLUUID::null && |
205 | (line.length() > chat.mFromName.length() && line.find(chat.mFromName,0) == 0)) | 206 | // [RLVa] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) |
207 | (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) | ||
208 | // [/RLVa] | ||
209 | { | ||
210 | chat.mURL = llformat("secondlife:///app/agent/%s/about",chat.mFromID.asString().c_str()); | ||
211 | } | ||
212 | |||
213 | // If the chat line has an associated url, link it up to the name. | ||
214 | if (!chat.mURL.empty() | ||
215 | && (line.length() > chat.mFromName.length() && line.find(chat.mFromName,0) == 0)) | ||
206 | { | 216 | { |
207 | std::string start_line = line.substr(0, chat.mFromName.length() + 1); | 217 | std::string start_line = line.substr(0, chat.mFromName.length() + 1); |
208 | line = line.substr(chat.mFromName.length() + 1); | 218 | line = line.substr(chat.mFromName.length() + 1); |
209 | const LLStyleSP &sourceStyle = LLStyleMap::instance().lookup(chat.mFromID); | 219 | const LLStyleSP &sourceStyle = LLStyleMap::instance().lookup(chat.mFromID,chat.mURL); |
210 | edit->appendStyledText(start_line, false, prepend_newline, &sourceStyle); | 220 | edit->appendStyledText(start_line, false, prepend_newline, sourceStyle); |
211 | prepend_newline = false; | 221 | prepend_newline = false; |
212 | } | 222 | } |
213 | edit->appendColoredText(line, false, prepend_newline, color); | 223 | edit->appendColoredText(line, false, prepend_newline, color); |
@@ -223,9 +233,61 @@ void log_chat_text(const LLChat& chat) | |||
223 | 233 | ||
224 | LLLogChat::saveHistory(std::string("chat"),histstr); | 234 | LLLogChat::saveHistory(std::string("chat"),histstr); |
225 | } | 235 | } |
236 | |||
237 | // static | ||
238 | void LLFloaterChat::toggleHistoryChannelControl() | ||
239 | { | ||
240 | LLFloaterChat* chat_floater = LLFloaterChat::getInstance(LLSD()); | ||
241 | BOOL visible = gSavedSettings.getBOOL("ChatChannelSelect"); | ||
242 | BOOL control = chat_floater->getChild<LLSpinCtrl>("channel_control")->getVisible(); | ||
243 | |||
244 | LLLineEditor* input = chat_floater->getChild<LLLineEditor>("Chat Editor"); | ||
245 | LLRect input_rect = input->getRect(); | ||
246 | S32 chan_width = chat_floater->getChild<LLSpinCtrl>("channel_control")->getRect().getWidth(); | ||
247 | |||
248 | if (visible && !control) | ||
249 | { | ||
250 | input_rect.setLeftTopAndSize(input_rect.mLeft+chan_width+4, input_rect.mTop, | ||
251 | input_rect.getWidth()-chan_width, input_rect.getHeight()); | ||
252 | } | ||
253 | else if (!visible && control) | ||
254 | { | ||
255 | input_rect.setLeftTopAndSize(input_rect.mLeft-chan_width-4, input_rect.mTop, | ||
256 | input_rect.getWidth()+chan_width, input_rect.getHeight()); | ||
257 | } | ||
258 | input->setRect(input_rect); | ||
259 | |||
260 | chat_floater->childSetVisible("channel_control", visible); | ||
261 | chat_floater->childSetEnabled("channel_control", visible); | ||
262 | } | ||
263 | |||
226 | // static | 264 | // static |
227 | void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file) | 265 | void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file) |
228 | { | 266 | { |
267 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | ||
268 | if (rlv_handler_t::isEnabled()) | ||
269 | { | ||
270 | // TODO-RLVa: we might cast too broad a net by filtering here, needs testing | ||
271 | if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) && (!chat.mRlvLocFiltered) && (CHAT_SOURCE_AGENT != chat.mSourceType) ) | ||
272 | { | ||
273 | LLChat& rlvChat = const_cast<LLChat&>(chat); | ||
274 | gRlvHandler.filterLocation(rlvChat.mText); | ||
275 | rlvChat.mRlvLocFiltered = TRUE; | ||
276 | } | ||
277 | if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!chat.mRlvNamesFiltered) ) | ||
278 | { | ||
279 | // NOTE: this will also filter inventory accepted/declined text in the chat history | ||
280 | LLChat& rlvChat = const_cast<LLChat&>(chat); | ||
281 | if (CHAT_SOURCE_AGENT != chat.mSourceType) | ||
282 | { | ||
283 | // Filter object and system chat (names are filtered elsewhere to save ourselves an gObjectList lookup) | ||
284 | gRlvHandler.filterNames(rlvChat.mText); | ||
285 | } | ||
286 | rlvChat.mRlvNamesFiltered = TRUE; | ||
287 | } | ||
288 | } | ||
289 | // [/RLVa:KB] | ||
290 | |||
229 | if ( gSavedPerAccountSettings.getBOOL("LogChat") && log_to_file) | 291 | if ( gSavedPerAccountSettings.getBOOL("LogChat") && log_to_file) |
230 | { | 292 | { |
231 | log_chat_text(chat); | 293 | log_chat_text(chat); |
@@ -356,6 +418,30 @@ void LLFloaterChat::addChat(const LLChat& chat, | |||
356 | chat.mChatType == CHAT_TYPE_DEBUG_MSG | 418 | chat.mChatType == CHAT_TYPE_DEBUG_MSG |
357 | && !gSavedSettings.getBOOL("ScriptErrorsAsChat"); | 419 | && !gSavedSettings.getBOOL("ScriptErrorsAsChat"); |
358 | 420 | ||
421 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | ||
422 | if (rlv_handler_t::isEnabled()) | ||
423 | { | ||
424 | // TODO-RLVa: we might cast too broad a net by filtering here, needs testing | ||
425 | if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) && (!chat.mRlvLocFiltered) && (CHAT_SOURCE_AGENT != chat.mSourceType) ) | ||
426 | { | ||
427 | LLChat& rlvChat = const_cast<LLChat&>(chat); | ||
428 | if (!from_instant_message) | ||
429 | gRlvHandler.filterLocation(rlvChat.mText); | ||
430 | rlvChat.mRlvLocFiltered = TRUE; | ||
431 | } | ||
432 | if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!chat.mRlvNamesFiltered) ) | ||
433 | { | ||
434 | LLChat& rlvChat = const_cast<LLChat&>(chat); | ||
435 | if ( (!from_instant_message) && (CHAT_SOURCE_AGENT != chat.mSourceType) ) | ||
436 | { | ||
437 | // Filter object and system chat (names are filtered elsewhere to save ourselves an gObjectList lookup) | ||
438 | gRlvHandler.filterNames(rlvChat.mText); | ||
439 | } | ||
440 | rlvChat.mRlvNamesFiltered = TRUE; | ||
441 | } | ||
442 | } | ||
443 | // [/RLVa:KB] | ||
444 | |||
359 | #if LL_LCD_COMPILE | 445 | #if LL_LCD_COMPILE |
360 | // add into LCD displays | 446 | // add into LCD displays |
361 | if (!invisible_script_debug_chat) | 447 | if (!invisible_script_debug_chat) |
@@ -513,7 +599,11 @@ void LLFloaterChat::onClickToggleActiveSpeakers(void* userdata) | |||
513 | { | 599 | { |
514 | LLFloaterChat* self = (LLFloaterChat*)userdata; | 600 | LLFloaterChat* self = (LLFloaterChat*)userdata; |
515 | 601 | ||
516 | self->childSetVisible("active_speakers_panel", !self->childIsVisible("active_speakers_panel")); | 602 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) |
603 | self->childSetVisible("active_speakers_panel", | ||
604 | (!self->childIsVisible("active_speakers_panel")) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ); | ||
605 | // [/RLVa:KB] | ||
606 | //self->childSetVisible("active_speakers_panel", !self->childIsVisible("active_speakers_panel")); | ||
517 | } | 607 | } |
518 | 608 | ||
519 | //static | 609 | //static |