diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp index ff0b79d3c75609c575ad9ffb6f3e8594f4556041..060d0b2b66ca4f079a9cd27b05ad1bf33f39b2dc 100644 --- a/indra/newview/llfloaterimnearbychat.cpp +++ b/indra/newview/llfloaterimnearbychat.cpp @@ -488,7 +488,10 @@ void LLFloaterIMNearbyChat::onChatBoxKeystroke() S32 length = raw_text.length(); - if( (length > 0) && (raw_text[0] != '/') ) // forward slash is used for escape (eg. emote) sequences + if( (length > 0) + && (raw_text[0] != '/') // forward slash is used for escape (eg. emote) sequences + && (raw_text[0] != ':') // colon is used in for MUD poses + ) { gAgent.startTyping(); } @@ -613,6 +616,8 @@ void LLFloaterIMNearbyChat::sendChat( EChatType type ) std::string utf8_revised_text; if (0 == channel) { + applyMUPose(utf8text); + // discard returned "found" boolean if(!LLGestureMgr::instance().triggerAndReviseString(utf8text, &utf8_revised_text)) { diff --git a/indra/newview/llfloaterimsession.cpp b/indra/newview/llfloaterimsession.cpp index ce8b67aef1dd67e4ac408baaeb7d1586135a1398..04a3c7e7f13ef64906a832cac86d1bdb40830648 100644 --- a/indra/newview/llfloaterimsession.cpp +++ b/indra/newview/llfloaterimsession.cpp @@ -321,7 +321,7 @@ void LLFloaterIMSession::sendMsgFromInputEditor() { // Truncate and convert to UTF8 for transport std::string utf8_text = wstring_to_utf8str(text); - + applyMUPose(utf8_text); sendMsg(utf8_text); mInputEditor->setText(LLStringUtil::null); diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 4ecc87e57a28326d88b0d728e68f81646770f416..30f1efa562e220f6ec2c3302748d3494bab69cc7 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -1181,6 +1181,30 @@ LLView* LLFloaterIMSessionTab::getChatHistory() return mChatHistory; } +// virtual +void LLFloaterIMSessionTab::applyMUPose(std::string& text) +{ + static LLCachedControl<bool> useMUPose(gSavedSettings, "AlchemyChatMUPose", false); + if (!useMUPose) + return; + + if (text.at(0) == ':' + && text.length() > 3) + { + if (text.find(":'") == 0) + { + text.replace(0, 1, "/me"); + } + // Account for emotes and smilies + else if (!isdigit(text.at(1)) + && !ispunct(text.at(1)) + && !isspace(text.at(1))) + { + text.replace(0, 1, "/me "); + } + } +} + BOOL LLFloaterIMSessionTab::handleKeyHere(KEY key, MASK mask ) { BOOL handled = FALSE; diff --git a/indra/newview/llfloaterimsessiontab.h b/indra/newview/llfloaterimsessiontab.h index ba5a372df4a909ee0c5f9e27442f64e3ad973e9e..484b921021df22888edf87fced731b0fceae5710 100644 --- a/indra/newview/llfloaterimsessiontab.h +++ b/indra/newview/llfloaterimsessiontab.h @@ -146,6 +146,8 @@ class LLFloaterIMSessionTab std::string appendTime(); void assignResizeLimits(); + + virtual void applyMUPose(std::string& text); S32 mFloaterExtraWidth;