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.cpp54
1 files changed, 35 insertions, 19 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index a90790c59a..4088eafe16 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -1431,6 +1431,17 @@ bool goto_url_callback(const LLSD& notification, const LLSD& response)
}
static LLNotificationFunctorRegistration goto_url_callback_reg("GotoURL", goto_url_callback);
+bool inspect_remote_object_callback(const LLSD& notification, const LLSD& response)
+{
+ S32 option = LLNotification::getSelectedOption(notification, response);
+ if (0 == option)
+ {
+ LLFloaterReg::showInstance("inspect_remote_object", notification["payload"]);
+ }
+ return false;
+}
+static LLNotificationFunctorRegistration inspect_remote_object_callback_reg("ServerObjectMessage", inspect_remote_object_callback);
+
void process_improved_im(LLMessageSystem *msg, void **user_data)
{
if (gNoRender)
@@ -1498,15 +1509,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
}
std::string separator_string(": ");
- int message_offset = 0;
-
- //Handle IRC styled /me messages.
- std::string prefix = message.substr(0, 4);
- if (prefix == "/me " || prefix == "/me'")
- {
- separator_string = "";
- message_offset = 3;
- }
LLSD args;
switch(dialog)
@@ -1558,7 +1560,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
// now store incoming IM in chat history
- buffer = message.substr(message_offset);
+ buffer = message;
LL_INFOS("Messaging") << "process_improved_im: session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL;
@@ -1576,7 +1578,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
true);
// pretend this is chat generated by self, so it does not show up on screen
- chat.mText = std::string("IM: ") + name + separator_string + message.substr(message_offset);
+ chat.mText = std::string("IM: ") + name + separator_string + message;
LLFloaterChat::addChat( chat, TRUE, TRUE );
}
else if (from_id.isNull())
@@ -1596,7 +1598,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
// Treat like a system message and put in chat history.
// Claim to be from a local agent so it doesn't go into
// console.
- chat.mText = name + separator_string + message.substr(message_offset);
+ chat.mText = name + separator_string + message;
LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD());
if(nearby_chat)
@@ -1612,7 +1614,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
{
saved = llformat("(Saved %s) ", formatted_time(timestamp).c_str());
}
- buffer = saved + message.substr(message_offset);
+ buffer = saved + message;
LL_INFOS("Messaging") << "process_improved_im: session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL;
@@ -1634,7 +1636,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
region_id,
position,
true);
- chat.mText = std::string("IM: ") + name + separator_string + saved + message.substr(message_offset);
+ chat.mText = std::string("IM: ") + name + separator_string + saved + message;
BOOL local_agent = FALSE;
LLFloaterChat::addChat( chat, TRUE, local_agent );
@@ -1922,7 +1924,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
{
saved = llformat("(Saved %s) ", formatted_time(timestamp).c_str());
}
- buffer = saved + message.substr(message_offset);
+ buffer = saved + message;
BOOL is_this_agent = FALSE;
if(from_id == gAgentID)
{
@@ -1940,7 +1942,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
position,
true);
- chat.mText = std::string("IM: ") + name + separator_string + saved + message.substr(message_offset);
+ chat.mText = std::string("IM: ") + name + separator_string + saved + message;
LLFloaterChat::addChat(chat, TRUE, is_this_agent);
}
break;
@@ -1952,9 +1954,23 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
return;
}
+ // Build a link to open the object IM info window.
+ std::string location = ll_safe_string((char*)binary_bucket, binary_bucket_size-1);
+
LLSD substitutions;
- substitutions["MSG"] = message.substr(message_offset);
- LLNotifications::instance().add("ServerObjectMessage", substitutions);
+ substitutions["NAME"] = name;
+ substitutions["MSG"] = message;
+
+ LLSD payload;
+ payload["object_id"] = session_id;
+ payload["owner_id"] = from_id;
+ payload["slurl"] = location;
+ payload["name"] = name;
+ if (from_group)
+ {
+ payload["groupowned"] = "true";
+ }
+ LLNotifications::instance().add("ServerObjectMessage", substitutions, payload);
}
break;
case IM_FROM_TASK_AS_ALERT:
@@ -1978,7 +1994,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
else
{
// TODO: after LLTrans hits release, get "busy response" into translatable file
- buffer = llformat("%s (%s): %s", name.c_str(), "busy response", message.substr(message_offset).c_str());
+ buffer = llformat("%s (%s): %s", name.c_str(), "busy response", message.c_str());
gIMMgr->addMessage(session_id, from_id, name, buffer);
}
break;