diff options
author | James Cook <james@lindenlab.com> | 2010-03-02 11:14:59 -0800 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2010-03-02 11:14:59 -0800 |
commit | 04d27007fdd46688c86be85013272da3373f77fc (patch) | |
tree | 9560dbef39951d12b4758fc8434a2b9140c66681 | |
parent | 541291b366c4813217be5cb9118cd74778d0daeb (diff) |
DEV-46936 SLID last name appears when resident returns an object to its owner
Fixed with some regular expression cleanup magic
-rw-r--r-- | indra/newview/llviewermessage.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 83d52fbbfc..0815ce486d 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1682,6 +1682,23 @@ static std::string clean_name_from_im(const std::string& name, EInstantMessage t } } +static std::string clean_name_from_task_im(const std::string& msg) +{ + boost::smatch match; + static const boost::regex returned_exp( + "(.*been returned to your inventory lost and found folder by )(.+)( (from|near).*)"); + if (boost::regex_match(msg, match, returned_exp)) + { + // match objects are 1-based for groups + std::string final = match[1].str(); + std::string name = match[2].str(); + final += LLCacheName::cleanFullName(name); + final += match[3].str(); + return final; + } + return msg; +} + void process_improved_im(LLMessageSystem *msg, void **user_data) { if (gNoRender) @@ -2234,6 +2251,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) chat.mFromID = from_id = LLUUID::null; } + // IDEVO Some messages have embedded resident names + message = clean_name_from_task_im(message); + LLSD query_string; query_string["owner"] = from_id; query_string["slurl"] = location; |