diff options
author | Dave SIMmONs <simon@lindenlab.com> | 2011-04-07 17:03:42 -0700 |
---|---|---|
committer | Dave SIMmONs <simon@lindenlab.com> | 2011-04-07 17:03:42 -0700 |
commit | b84ac95c2fa3f020b656737244c38222351b8d36 (patch) | |
tree | 2594c73b13d2fc0ffe849a0af08e3066daf264ad /indra/newview/llnearbychathandler.cpp | |
parent | 37c15d211b55d979ecea78237b22513ee663eb7a (diff) |
ER-671: add llRegionSayTo(). Cleaned up some chat code, implemented '@' special case. Reviewed by Kelly
Diffstat (limited to 'indra/newview/llnearbychathandler.cpp')
-rw-r--r-- | indra/newview/llnearbychathandler.cpp | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index 2566bf1095..11dc496311 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -489,6 +489,27 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args) // tmp_chat.mFromName = tmp_chat.mFromID.asString(); } + // Build notification data + LLSD notification; + notification["message"] = chat_msg.mText; + notification["from"] = chat_msg.mFromName; + notification["from_id"] = chat_msg.mFromID; + notification["time"] = chat_msg.mTime; + notification["source"] = (S32)chat_msg.mSourceType; + notification["chat_type"] = (S32)chat_msg.mChatType; + notification["chat_style"] = (S32)chat_msg.mChatStyle; + // Pass sender info so that it can be rendered properly (STORM-1021). + notification["sender_slurl"] = LLViewerChat::getSenderSLURL(chat_msg, args); + + if (chat_msg.mChatType == CHAT_TYPE_DIRECT && + chat_msg.mText.length() > 0 && + chat_msg.mText[0] == '@') + { + // Send event on to LLEventStream and exit + sChatWatcher->post(notification); + return; + } + // don't show toast and add message to chat history on receive debug message // with disabled setting showing script errors or enabled setting to show script // errors in separate window. @@ -531,19 +552,7 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args) } - // Build data and send event on to LLEventStream - LLSD notification; - notification["message"] = chat_msg.mText; - notification["from"] = chat_msg.mFromName; - notification["from_id"] = chat_msg.mFromID; - notification["time"] = chat_msg.mTime; - notification["source"] = (S32)chat_msg.mSourceType; - notification["chat_type"] = (S32)chat_msg.mChatType; - notification["chat_style"] = (S32)chat_msg.mChatStyle; - // Pass sender info so that it can be rendered properly (STORM-1021). - notification["sender_slurl"] = LLViewerChat::getSenderSLURL(chat_msg, args); - - + // Send event on to LLEventStream sChatWatcher->post(notification); |