summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rw-r--r--indra/newview/llviewermessage.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 4fe5beceae..d1c773171b 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -2600,10 +2600,11 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
BOOL ircstyle = FALSE;
- chat.mIsScript = (mesg.substr(0, LUA_PREFIX.size()) == LUA_PREFIX);
+ auto [message, is_script] = LLStringUtil::withoutPrefix(mesg, LUA_PREFIX);
+ chat.mIsScript = is_script;
// Look for IRC-style emotes here so chatbubbles work
- std::string prefix = mesg.substr(chat.mIsScript ? LUA_PREFIX.size() : 0, 4);
+ std::string prefix = message.substr(0, 4);
if (prefix == "/me " || prefix == "/me'")
{
ircstyle = TRUE;