diff options
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rw-r--r-- | indra/newview/llviewermessage.cpp | 64 |
1 files changed, 48 insertions, 16 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 9641a0901c..01a5cb18db 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -122,6 +122,7 @@ // const F32 BIRD_AUDIBLE_RADIUS = 32.0f; const F32 SIT_DISTANCE_FROM_TARGET = 0.25f; +const F32 CAMERA_POSITION_THRESHOLD_SQUARED = 0.001f * 0.001f; static const F32 LOGOUT_REPLY_TIME = 3.f; // Wait this long after LogoutReply before quitting. // Determine how quickly residents' scripts can issue question dialogs @@ -343,6 +344,11 @@ void process_layer_data(LLMessageSystem *mesgsys, void **user_data) { LLViewerRegion *regionp = LLWorld::getInstance()->getRegion(mesgsys->getSender()); + if(!regionp) + { + llwarns << "Invalid region for layer data." << llendl; + return; + } S32 size; S8 type; @@ -2207,7 +2213,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) name = clean_name_from_im(name, dialog); BOOL is_busy = gAgent.getBusy(); - BOOL is_muted = LLMuteList::getInstance()->isMuted(from_id, name, LLMute::flagTextChat); + BOOL is_muted = LLMuteList::getInstance()->isMuted(from_id, name, LLMute::flagTextChat) + // object IMs contain sender object id in session_id (STORM-1209) + || dialog == IM_FROM_TASK && LLMuteList::getInstance()->isMuted(session_id); BOOL is_linden = LLMuteList::getInstance()->isLinden(name); BOOL is_owned_by_me = FALSE; BOOL is_friend = (LLAvatarTracker::instance().getBuddyInfo(from_id) == NULL) ? false : true; @@ -2595,6 +2603,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) args["NAME"] = LLSLURL("agent", from_id, "completename").getSLURLString();; LLSD payload; payload["from_id"] = from_id; + // Passing the "SESSION_NAME" to use it for IM notification logging + // in LLTipHandler::processNotification(). See STORM-941. + payload["SESSION_NAME"] = name; LLNotificationsUtil::add("InventoryAccepted", args, payload); break; } @@ -2794,7 +2805,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) { LLVector3 pos, look_at; U64 region_handle; - U8 region_access = SIM_ACCESS_MIN; + U8 region_access; std::string region_info = ll_safe_string((char*)binary_bucket, binary_bucket_size); std::string region_access_str = LLStringUtil::null; std::string region_access_icn = LLStringUtil::null; @@ -3202,7 +3213,6 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) if (is_audible) { BOOL visible_in_chat_bubble = FALSE; - std::string verb; color.setVec(1.f,1.f,1.f,1.f); msg->getStringFast(_PREHASH_ChatData, _PREHASH_Message, mesg); @@ -3251,18 +3261,19 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) } else { + chat.mText = ""; switch(chat.mChatType) { case CHAT_TYPE_WHISPER: - verb = LLTrans::getString("whisper") + " "; + chat.mText = LLTrans::getString("whisper") + " "; break; case CHAT_TYPE_DEBUG_MSG: case CHAT_TYPE_OWNER: case CHAT_TYPE_NORMAL: - verb = ""; + case CHAT_TYPE_DIRECT: break; case CHAT_TYPE_SHOUT: - verb = LLTrans::getString("shout") + " "; + chat.mText = LLTrans::getString("shout") + " "; break; case CHAT_TYPE_START: case CHAT_TYPE_STOP: @@ -3270,13 +3281,9 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) break; default: LL_WARNS("Messaging") << "Unknown type " << chat.mChatType << " in chat!" << LL_ENDL; - verb = ""; break; } - - chat.mText = ""; - chat.mText += verb; chat.mText += mesg; } @@ -4325,6 +4332,9 @@ void process_sound_trigger(LLMessageSystem *msg, void **) { return; } + + // Don't play sounds from gestures if they are not enabled. + if (!gSavedSettings.getBOOL("EnableGestureSounds")) return; gAudiop->triggerSound(sound_id, owner_id, gain, LLAudioEngine::AUDIO_TYPE_SFX, pos_global); } @@ -4745,7 +4755,7 @@ void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data) BOOL force_mouselook; mesgsys->getBOOLFast(_PREHASH_SitTransform, _PREHASH_ForceMouselook, force_mouselook); - if (isAgentAvatarValid() && dist_vec_squared(camera_eye, camera_at) > 0.0001f) + if (isAgentAvatarValid() && dist_vec_squared(camera_eye, camera_at) > CAMERA_POSITION_THRESHOLD_SQUARED) { gAgentCamera.setSitCamera(sitObjectID, camera_eye, camera_at); } @@ -5365,6 +5375,12 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) { // notification was specified using the new mechanism, so we can just handle it here std::string notificationID; + msgsystem->getStringFast(_PREHASH_AlertInfo, _PREHASH_Message, notificationID); + if (!LLNotifications::getInstance()->templateExists(notificationID)) + { + return false; + } + std::string llsdRaw; LLSD llsdBlock; msgsystem->getStringFast(_PREHASH_AlertInfo, _PREHASH_Message, notificationID); @@ -5521,10 +5537,19 @@ void process_alert_core(const std::string& message, BOOL modal) } else { - LLSD args; - std::string new_msg =LLNotifications::instance().getGlobalString(message); - args["MESSAGE"] = new_msg; - LLNotificationsUtil::add("SystemMessageTip", args); + // Hack fix for EXP-623 (blame fix on RN :)) to avoid a sim deploy + const std::string AUTOPILOT_CANCELED_MSG("Autopilot canceled"); + if (message.find(AUTOPILOT_CANCELED_MSG) == std::string::npos ) + { + LLSD args; + std::string new_msg =LLNotifications::instance().getGlobalString(message); + + std::string localized_msg; + bool is_message_localized = LLTrans::findString(localized_msg, new_msg); + + args["MESSAGE"] = is_message_localized ? localized_msg : new_msg; + LLNotificationsUtil::add("SystemMessageTip", args); + } } } @@ -6463,7 +6488,14 @@ void process_script_dialog(LLMessageSystem* msg, void**) LLUUID object_id; msg->getUUID("Data", "ObjectID", object_id); - if (LLMuteList::getInstance()->isMuted(object_id)) +// For compability with OS grids first check for presence of extended packet before fetching data. + LLUUID owner_id; + if (gMessageSystem->getNumberOfBlocks("OwnerData") > 0) + { + msg->getUUID("OwnerData", "OwnerID", owner_id); + } + + if (LLMuteList::getInstance()->isMuted(object_id) || LLMuteList::getInstance()->isMuted(owner_id)) { return; } |