From 22ae981afb86e31eed777d57e16151c1b7de30ae Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Thu, 15 Jul 2010 17:13:38 -0700 Subject: DEV-50739 Message recieved by Send Message to Region function is from Username only reviewed by Richard cc#221 --- indra/newview/llviewermessage.cpp | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) (limited to 'indra/newview') 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("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("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 { -- cgit v1.2.3