aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterchat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llfloaterchat.cpp')
-rw-r--r--linden/indra/newview/llfloaterchat.cpp35
1 files changed, 1 insertions, 34 deletions
diff --git a/linden/indra/newview/llfloaterchat.cpp b/linden/indra/newview/llfloaterchat.cpp
index 4be20b5..1cf85de 100644
--- a/linden/indra/newview/llfloaterchat.cpp
+++ b/linden/indra/newview/llfloaterchat.cpp
@@ -459,41 +459,8 @@ BOOL LLFloaterChat::isOwnNameInText(const std::string &text_line)
459 std::string pattern_s = "(^|.*[\\.\\?!:;\\*\\(\\s]+)(" + my_name + ")([,\\.\\?!:;\\*\\)\\s]+.*|$)"; 459 std::string pattern_s = "(^|.*[\\.\\?!:;\\*\\(\\s]+)(" + my_name + ")([,\\.\\?!:;\\*\\)\\s]+.*|$)";
460 boost::smatch what; 460 boost::smatch what;
461 boost::regex e1(pattern_s, boost::regex::icase); 461 boost::regex e1(pattern_s, boost::regex::icase);
462 return boost::regex_search(text_line, what, e1);
463
464/*
465 std::transform(my_name.begin(), my_name.end(), my_name.begin(), tolower);
466
467 std::string lower_chat = std::string(text_line);
468 std::transform(lower_chat.begin(), lower_chat.end(), lower_chat.begin(), tolower);
469 462
470 std::string blank = " "; 463 return boost::regex_search(text_line, what, e1);
471
472 // yes yes, this sucks, will move to a nicer regexp as soon as i have time to make it lol
473 if (lower_chat.find(my_name + blank) == 0 || // at the beginning of the text
474 (lower_chat.find(my_name) == 0 && lower_chat.length() == my_name.length()) || // only my name in the text
475 lower_chat.find(blank + my_name + blank) != std::string::npos || // my name in the middle of the text
476 lower_chat.rfind(blank + my_name) == lower_chat.length() - (blank + my_name).length()) // my name at the end of the text
477 {
478 return TRUE;
479 }
480
481 return FALSE;
482*/
483
484/*
485 regex_t compiled;
486 // ^.*([\.\?!:;\*\(\s]+)(elektra)([,\.\?!:;\*\)\s$]+).* <--- this works :)
487 std::string pre_pattern = "^.*([\\.\\?!:;\\*\\(\\s]+)(";
488 std::string post_pattern = ")([,\\.\\?!:;\\*\\)\\s$]+).*";
489 std::string pattern_s = pre_pattern + my_name + post_pattern;
490 regcomp(&compiled, pattern_s.c_str(), REG_ICASE);
491
492 if (regexec(&compiled, text_line.c_str(), 0, NULL, 0) == 0)
493 return TRUE;
494
495 return FALSE;
496*/
497} 464}
498 465
499LLColor4 get_extended_text_color(const LLChat& chat, LLColor4 defaultColor) 466LLColor4 get_extended_text_color(const LLChat& chat, LLColor4 defaultColor)