diff options
author | Leyla Farazha <leyla@lindenlab.com> | 2010-07-15 17:13:38 -0700 |
---|---|---|
committer | Leyla Farazha <leyla@lindenlab.com> | 2010-07-15 17:13:38 -0700 |
commit | 22ae981afb86e31eed777d57e16151c1b7de30ae (patch) | |
tree | a25fe5845cc9623f96d4185c73de6f14c7045706 /indra/newview/llviewermessage.cpp | |
parent | 5546f78fff25e59b57eb0a62d9ecacdd5c904b3d (diff) |
DEV-50739 Message recieved by Send Message to Region function is from Username only
reviewed by Richard cc#221
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rw-r--r-- | indra/newview/llviewermessage.cpp | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 6f2b684834..83dec4383c 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2093,6 +2093,25 @@ protected: }; +// Callback for name resolution of a god/estate message +void god_message_name_cb(const LLAvatarName& av_name, LLChat chat, std::string message) +{ + LLSD args; + args["NAME"] = av_name.getCompleteName(); + args["MESSAGE"] = message; + LLNotificationsUtil::add("GodMessage", args); + + // Treat like a system message and put in chat history. + chat.mText = av_name.getCompleteName() + ": " + message; + + LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD()); + if(nearby_chat) + { + nearby_chat->addMessage(chat); + } + +} + void process_improved_im(LLMessageSystem *msg, void **user_data) { if (gNoRender) @@ -2240,21 +2259,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } else if (to_id.isNull()) { - // Message to everyone from GOD - args["NAME"] = name; - args["MESSAGE"] = message; - LLNotificationsUtil::add("GodMessage", args); - - // 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; - - LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD()); - if(nearby_chat) - { - nearby_chat->addMessage(chat); - } + // Message to everyone from GOD, look up the fullname since + // server always slams name to legacy names + LLAvatarNameCache::get(from_id, boost::bind(god_message_name_cb, _2, chat, message)); } else { |