From 06837a2a7775fcc40642d58d265a5e9be61f6621 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 5 Feb 2012 14:22:52 -0500 Subject: [PATCH 1/6] Stop prepending ((\[[ to actions that end with ))/]], fix compile warning for npos, and remove unnecessary checks from sendMsg() Users can have their actions not get broken should they end with )) or ]] without beginning OOC, while AutoOOC is enabled. --- indra/newview/llimpanel.cpp | 69 ++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 0c834da53..56375829a 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -2156,59 +2156,58 @@ void LLFloaterIMPanel::sendMsg() if (mInputEditor) mInputEditor->updateHistory(); // Truncate and convert to UTF8 for transport std::string utf8text = wstring_to_utf8str(text); + // Convert MU*s style poses into IRC emotes here. + if (gSavedSettings.getBOOL("AscentAllowMUpose") && utf8text.length() > 3 && utf8text[0] == ':') + { + if (utf8text[1] == '\'') + { + utf8text.replace(0, 1, "/me"); + } + else if (isalpha(utf8text[1])) // Do not prevent smileys and such. + { + utf8text.replace(0, 1, "/me "); + } + } + if (utf8text.find("/ME'") == 0 || utf8text.find("/ME ") == 0) //Allow CAPSlock /me + utf8text.replace(1, 2, "me"); + std::string prefix = utf8text.substr(0, 4); if (gSavedSettings.getBOOL("AscentAutoCloseOOC") && (utf8text.length() > 1) && !mRPMode) { // Chalice - OOC autoclosing patch based on code by Henri Beauchamp int needsClosingType=0; //Check if it needs the end-of-chat brackets -HgB - if (utf8text.find("((") == 0 && utf8text.find("))") == -1) + if (utf8text.find("((") == 0 && utf8text.find("))") == std::string::npos) { - if(utf8text.at(utf8text.length() - 1) == ')') + if(*utf8text.rbegin() == ')') utf8text+=" "; utf8text+="))"; } - else if(utf8text.find("[[") == 0 && utf8text.find("]]") == -1) + else if(utf8text.find("[[") == 0 && utf8text.find("]]") == std::string::npos) { - if(utf8text.at(utf8text.length() - 1) == ']') + if(*utf8text.rbegin() == ']') utf8text+=" "; utf8text+="]]"; } //Check if it needs the start-of-chat brackets -HgB needsClosingType=0; - if (utf8text.find("((") == -1 && utf8text.find("))") == (utf8text.length() - 2)) + if (prefix != "/me " && prefix != "/me'") //Allow /me to end with )) or ]] { - if(utf8text.at(0) == '(') - utf8text.insert(0," "); - utf8text.insert(0,"(("); - } - else if (utf8text.find("[[") == -1 && utf8text.find("]]") == (utf8text.length() - 2)) - { - if(utf8text.at(0) == '[') - utf8text.insert(0," "); - utf8text.insert(0,"[["); + if (utf8text.find("((") == std::string::npos && utf8text.find("))") == (utf8text.length() - 2)) + { + if(utf8text[0] == '(') + utf8text.insert(0," "); + utf8text.insert(0,"(("); + } + else if (utf8text.find("[[") == std::string::npos && utf8text.find("]]") == (utf8text.length() - 2)) + { + if(utf8text[0] == '[') + utf8text.insert(0," "); + utf8text.insert(0,"[["); + } } } - // Convert MU*s style poses into IRC emotes here. - if (gSavedSettings.getBOOL("AscentAllowMUpose") && utf8text.find(":") == 0 && utf8text.length() > 3) - { - if (utf8text.find(":'") == 0) - { - utf8text.replace(0, 1, "/me"); - } - else if (isalpha(utf8text.at(1))) // Do not prevent smileys and such. - { - utf8text.replace(0, 1, "/me "); - } - } - - if (utf8text.find("/ME'") == 0 || utf8text.find("/ME ") == 0) //Allow CAPSlock /me - { - utf8text.replace(1, 2, "me"); - } - std::string prefix = utf8text.substr(0, 4); - if (prefix != "/me " && prefix != "/me'") - if (mRPMode) utf8text = "[[" + utf8text + "]]"; - + if (mRPMode && prefix != "/me " && prefix != "/me'") + utf8text = "[[" + utf8text + "]]"; // [RLVa:KB] - Checked: 2011-09-17 (RLVa-1.1.4b) | Modified: RLVa-1.1.4b if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SENDIMTO)) ) { From ad24fcca398668886db29aed5faa8fc5fee991f2 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 5 Feb 2012 14:36:45 -0500 Subject: [PATCH 2/6] Culling, shouldn't affect appearance. (anymore) --- .../xui/en-us/panel_speaker_controls.xml | 83 +++++-------------- 1 file changed, 22 insertions(+), 61 deletions(-) diff --git a/indra/newview/skins/default/xui/en-us/panel_speaker_controls.xml b/indra/newview/skins/default/xui/en-us/panel_speaker_controls.xml index aa721d9cf..200e4e44f 100644 --- a/indra/newview/skins/default/xui/en-us/panel_speaker_controls.xml +++ b/indra/newview/skins/default/xui/en-us/panel_speaker_controls.xml @@ -1,70 +1,31 @@ - - - (Moderator) - - - - - - Voices on by default - - - Voices off by default - + + (Moderator) + + + + Voices on by default + Voices off by default - - - - - + + + + + - -