FIRE-7625: Option to display group chats, IM sessions and nearby chat always in uppercase

PanteraPolnocy 2012-10-21 01:52:50 +02:00
parent d46e501613
commit 8fcf4829a4
6 changed files with 66 additions and 1 deletions

View File

@ -18818,5 +18818,16 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Value</key>
<real>2.0</real>
</map>
<key>FSChatsUppercase</key>
<map>
<key>Comment</key>
<string>Group chats, IM sessions and nearby chat always in uppercase.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
</map>
</llsd>

View File

@ -842,6 +842,15 @@ static void on_avatar_name_cache_notify(const LLUUID& agent_id,
// If there's an open IM session with this agent, send a notification there too.
LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, agent_id);
std::string notify_msg = notification->getMessage();
// <FS:PP> FIRE-7625: Option to display group chats, IM sessions and nearby chat always in uppercase
static LLCachedControl<bool> oFSChatsUppercase(gSavedSettings, "FSChatsUppercase");
if (oFSChatsUppercase)
{
LLStringUtil::toUpper(notify_msg);
}
// </FS:PP>
LLIMModel::instance().proccessOnlineOfflineNotification(session_id, notify_msg);
// If desired, also send it to nearby chat, this allows friends'
// online/offline times to be referenced in chat & logged.

View File

@ -931,7 +931,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
// FS:LO FIRE-2899 - Faded text for IMs in nearby chat
//IRC styled /me messages.
bool irc_me = prefix == "/me " || prefix == "/me'";
bool irc_me = prefix == "/me " || prefix == "/me'" || prefix == "/ME " || prefix == "/ME'";
// Delimiter after a name in header copy/past and in plain text mode
std::string delimiter = ": ";
@ -1413,6 +1413,15 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
}
// FS:LO FIRE-2899 - Faded text for IMs in nearby chat
// <FS:PP> FIRE-7625: Option to display group chats, IM sessions and nearby chat always in uppercase
static LLCachedControl<bool> sFSChatsUppercase(gSavedSettings, "FSChatsUppercase");
if (sFSChatsUppercase)
{
LLStringUtil::toUpper(message);
LLStringUtil::toUpper(mLastFromName);
}
// </FS:PP>
mEditor->appendText(message, FALSE, style_params);
}

View File

@ -4143,6 +4143,10 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
}
return;
}
// <FS:PP> FIRE-7625: Option to display group chats, IM sessions and nearby chat always in uppercase
static LLCachedControl<bool> aFSChatsUppercase(gSavedSettings, "FSChatsUppercase");
bool allowConvertChatUppercase = true;
// </FS:PP>
// Look for IRC-style emotes
if (ircstyle)
@ -4177,6 +4181,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
{
mesg.erase(0, 1);
LLStringUtil::toLower(mesg);
allowConvertChatUppercase = false;
std::string strExecuted, strFailed, strRetained, *pstr;
@ -4253,6 +4258,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
if ( (rlv_handler_t::isEnabled()) && (chatter) && (chat.mSourceType == CHAT_SOURCE_OBJECT) &&
(gSavedSettings.getBOOL("EffectScriptChatParticles")) )
{
allowConvertChatUppercase = false;
LLPointer<LLViewerPartSourceChat> psc = new LLViewerPartSourceChat(chatter->getPositionAgent());
psc->setSourceObject(chatter);
psc->setColor(color);
@ -4272,15 +4278,26 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
case CHAT_TYPE_START:
case CHAT_TYPE_STOP:
LL_WARNS("Messaging") << "Got chat type start/stop in main chat processing." << LL_ENDL;
allowConvertChatUppercase = false;
break;
default:
LL_WARNS("Messaging") << "Unknown type " << chat.mChatType << " in chat!" << LL_ENDL;
allowConvertChatUppercase = false;
break;
}
chat.mText += mesg;
}
// <FS:PP> FIRE-7625: Option to display group chats, IM sessions and nearby chat always in uppercase
if (aFSChatsUppercase && allowConvertChatUppercase)
{
std::string chatMessageUppercase = chat.mText;
LLStringUtil::toUpper(chatMessageUppercase);
chat.mText = chatMessageUppercase;
}
// </FS:PP>
// We have a real utterance now, so can stop showing "..." and proceed.
if (chatter && chatter->isAvatar())
{
@ -4293,6 +4310,15 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
std::string formated_msg = "";
LLViewerChat::formatChatMsg(chat, formated_msg);
LLChat chat_bubble = chat;
// <FS:PP> FIRE-7625: Option to display group chats, IM sessions and nearby chat always in uppercase
// Chat bubbles
if (aFSChatsUppercase && allowConvertChatUppercase)
{
LLStringUtil::toUpper(formated_msg);
}
// </FS:PP>
chat_bubble.mText = formated_msg;
((LLVOAvatar*)chatter)->addChat(chat_bubble);
}

View File

@ -144,6 +144,15 @@
width="60" />
</radio_group>
<check_box
control_name="FSChatsUppercase"
height="16"
label="Display Group chats, IM sessions and nearby chat always in uppercase"
layout="topleft"
left="30"
name="chat_always_in_uppercase"
top_pad="5"
width="400" />
<check_box
control_name="PlayTypingAnim"
height="16"

View File

@ -20,6 +20,7 @@
<radio_item label="Duża" name="consradio3"/>
<radio_item label="Ogromna" name="consradio4"/>
</radio_group>
<check_box label="Wyświetlaj czaty grupowe, wiadomości IM oraz czat lokalny zawsze dużymi literami" name="chat_always_in_uppercase"/>
<check_box label="Używaj animacji podczas pisania" name="play_typing_animation"/>
<check_box label="Odtwarzaj animacje awatara (np. krzyczenie)" name="play_avatar_animations"/>
<check_box label="Dźwięk pisania, gdy inne osoby piszą w czacie lokalnym" name="play_typing_sound"/>