diff options
author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2024-08-26 14:47:24 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-26 14:47:24 +0300 |
commit | 3919e85f89d2d95af3bd4b824293d6eda6a80162 (patch) | |
tree | 2954f150be8bf8aef701d647268f4a93d2c8a7b5 /indra/newview | |
parent | 7ee93ea34dfc41640f852279888bbee0cafcecbe (diff) | |
parent | 3cc48ac9e22fb562560929a5c45a8b6ef1ecc841 (diff) |
Merge pull request #2400 from secondlife/lua-issue-2385
Fix for #2385: say, shout and whisper messages from the script should be displayed consistently
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llviewermessage.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 26b088e390..56f759833c 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2646,19 +2646,25 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) else { chat.mText = ""; + auto [msg_without_prefix, is_lua] = LLStringUtil::withoutPrefix(mesg, LUA_PREFIX); + std::string prefix; + if (is_lua) + { + prefix = LUA_PREFIX; + } switch(chat.mChatType) { case CHAT_TYPE_WHISPER: - chat.mText = LLTrans::getString("whisper") + " "; + prefix += LLTrans::getString("whisper") + " "; + break; + case CHAT_TYPE_SHOUT: + prefix += LLTrans::getString("shout") + " "; break; case CHAT_TYPE_DEBUG_MSG: case CHAT_TYPE_OWNER: case CHAT_TYPE_NORMAL: case CHAT_TYPE_DIRECT: break; - case CHAT_TYPE_SHOUT: - chat.mText = LLTrans::getString("shout") + " "; - break; case CHAT_TYPE_START: case CHAT_TYPE_STOP: LL_WARNS("Messaging") << "Got chat type start/stop in main chat processing." << LL_ENDL; @@ -2668,7 +2674,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) break; } - chat.mText += mesg; + chat.mText = prefix + msg_without_prefix; } // We have a real utterance now, so can stop showing "..." and proceed. |