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.cpp50
1 files changed, 43 insertions, 7 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 426edb37ca..eeedb98250 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -1803,15 +1803,51 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
break;
case IM_FROM_TASK:
- if (is_busy && !is_owned_by_me)
{
- return;
+ if (is_busy && !is_owned_by_me)
+ {
+ return;
+ }
+ chat.mText = name + separator_string + message.substr(message_offset);
+ chat.mFromName = name;
+
+ // Build a link to open the object IM info window.
+ std::string location = ll_safe_string((char*)binary_bucket,binary_bucket_size);
+
+ LLSD query_string;
+ query_string["owner"] = from_id;
+ query_string["slurl"] = location.c_str();
+ query_string["name"] = name;
+ if (from_group)
+ {
+ query_string["groupowned"] = "true";
+ }
+
+ if (session_id.notNull())
+ {
+ chat.mFromID = session_id;
+ }
+ else
+ {
+ // This message originated on a region without the updated code for task id and slurl information.
+ // We just need a unique ID for this object that isn't the owner ID.
+ // If it is the owner ID it will overwrite the style that contains the link to that owner's profile.
+ // This isn't ideal - it will make 1 style for all objects owned by the the same person/group.
+ // This works because the only thing we can really do in this case is show the owner name and link to their profile.
+ chat.mFromID = from_id ^ gAgent.getSessionID();
+ }
+
+ std::ostringstream link;
+ link << "secondlife:///app/objectim/" << session_id
+ << LLURI::mapToQueryString(query_string);
+
+ chat.mURL = link.str();
+
+ // Note: lie to LLFloaterChat::addChat(), pretending that this is NOT an IM, because
+ // IMs from objcts don't open IM sessions.
+ chat.mSourceType = CHAT_SOURCE_OBJECT;
+ LLFloaterChat::addChat(chat, FALSE, FALSE);
}
- chat.mText = name + separator_string + message.substr(message_offset);
- // Note: lie to LLFloaterChat::addChat(), pretending that this is NOT an IM, because
- // IMs from objcts don't open IM sessions.
- chat.mSourceType = CHAT_SOURCE_OBJECT;
- LLFloaterChat::addChat(chat, FALSE, FALSE);
break;
case IM_FROM_TASK_AS_ALERT:
if (is_busy && !is_owned_by_me)