From b285fd4d0abf9113fc416c30ac115db06c9f2ebf Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Tue, 5 Oct 2010 16:42:24 -0700 Subject: Fix for EXP-131 "Call dialog shown in locked position when a Resident calls a Skylight visitor" Added the setting VoiceCallsRejectAll, which causes the viewer to silently reject all incoming voice calls. Reviewed by Callum. --- indra/newview/llimview.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'indra/newview/llimview.cpp') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 01e1c3caa0..6b4e1f7289 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -2571,17 +2571,16 @@ void LLIMMgr::inviteToSession( if (type == IM_SESSION_P2P_INVITE || ad_hoc_invite) { - // is the inviter a friend? - if (LLAvatarTracker::instance().getBuddyInfo(caller_id) == NULL) - { - // if not, and we are ignoring voice invites from non-friends - // then silently decline - if (gSavedSettings.getBOOL("VoiceCallsFriendsOnly")) - { - // invite not from a friend, so decline - LLNotifications::instance().forceResponse(LLNotification::Params("VoiceInviteP2P").payload(payload), 1); - return; - } + + if ( // if we're rejecting all incoming call requests + gSavedSettings.getBOOL("VoiceCallsRejectAll") + // or we're rejecting non-friend voice calls and this isn't a friend + || (gSavedSettings.getBOOL("VoiceCallsFriendsOnly") && (LLAvatarTracker::instance().getBuddyInfo(caller_id) == NULL)) + ) + { + // silently decline the call + LLNotifications::instance().forceResponse(LLNotification::Params("VoiceInviteP2P").payload(payload), 1); + return; } } -- cgit v1.2.3 From c154e4b794489ff876b60b9ccfcb72ec1836cea2 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Thu, 7 Oct 2010 14:07:31 -0700 Subject: Made VoiceCallsRejectAll apply to group voice invites as well as p2p and ad-hoc invites. Fixed some code in LLIMMgr that had the incoming call dialog confused with a notification. Reviewed by Richard. --- indra/newview/llimview.cpp | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) (limited to 'indra/newview/llimview.cpp') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 6b4e1f7289..87a43a48dd 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1990,7 +1990,7 @@ void LLIncomingCallDialog::onOpen(const LLSD& key) void LLIncomingCallDialog::onAccept(void* user_data) { LLIncomingCallDialog* self = (LLIncomingCallDialog*)user_data; - self->processCallResponse(0); + processCallResponse(0, self->mPayload); self->closeFloater(); } @@ -1998,7 +1998,7 @@ void LLIncomingCallDialog::onAccept(void* user_data) void LLIncomingCallDialog::onReject(void* user_data) { LLIncomingCallDialog* self = (LLIncomingCallDialog*)user_data; - self->processCallResponse(1); + processCallResponse(1, self->mPayload); self->closeFloater(); } @@ -2006,20 +2006,21 @@ void LLIncomingCallDialog::onReject(void* user_data) void LLIncomingCallDialog::onStartIM(void* user_data) { LLIncomingCallDialog* self = (LLIncomingCallDialog*)user_data; - self->processCallResponse(2); + processCallResponse(2, self->mPayload); self->closeFloater(); } -void LLIncomingCallDialog::processCallResponse(S32 response) +// static +void LLIncomingCallDialog::processCallResponse(S32 response, const LLSD &payload) { if (!gIMMgr || gDisconnected) return; - LLUUID session_id = mPayload["session_id"].asUUID(); - LLUUID caller_id = mPayload["caller_id"].asUUID(); - std::string session_name = mPayload["session_name"].asString(); - EInstantMessage type = (EInstantMessage)mPayload["type"].asInteger(); - LLIMMgr::EInvitationType inv_type = (LLIMMgr::EInvitationType)mPayload["inv_type"].asInteger(); + LLUUID session_id = payload["session_id"].asUUID(); + LLUUID caller_id = payload["caller_id"].asUUID(); + std::string session_name = payload["session_name"].asString(); + EInstantMessage type = (EInstantMessage)payload["type"].asInteger(); + LLIMMgr::EInvitationType inv_type = (LLIMMgr::EInvitationType)payload["inv_type"].asInteger(); bool voice = true; switch(response) { @@ -2036,8 +2037,8 @@ void LLIncomingCallDialog::processCallResponse(S32 response) session_id = gIMMgr->addP2PSession( session_name, caller_id, - mPayload["session_handle"].asString(), - mPayload["session_uri"].asString()); + payload["session_handle"].asString(), + payload["session_uri"].asString()); if (voice) { @@ -2098,10 +2099,10 @@ void LLIncomingCallDialog::processCallResponse(S32 response) inv_type)); // send notification message to the corresponding chat - if (mPayload["notify_box_type"].asString() == "VoiceInviteGroup" || mPayload["notify_box_type"].asString() == "VoiceInviteAdHoc") + if (payload["notify_box_type"].asString() == "VoiceInviteGroup" || payload["notify_box_type"].asString() == "VoiceInviteAdHoc") { LLStringUtil::format_map_t string_args; - string_args["[NAME]"] = mPayload["caller_name"].asString(); + string_args["[NAME]"] = payload["caller_name"].asString(); std::string message = LLTrans::getString("name_started_call", string_args); LLIMModel::getInstance()->addMessageSilently(session_id, SYSTEM_FROM, LLUUID::null, message); } @@ -2118,7 +2119,7 @@ void LLIncomingCallDialog::processCallResponse(S32 response) { if(LLVoiceClient::getInstance()) { - std::string s = mPayload["session_handle"].asString(); + std::string s = payload["session_handle"].asString(); LLVoiceClient::getInstance()->declineInvite(s); } } @@ -2525,16 +2526,19 @@ void LLIMMgr::inviteToSession( std::string question_type = "VoiceInviteQuestionDefault"; BOOL ad_hoc_invite = FALSE; + BOOL voice_invite = FALSE; if(type == IM_SESSION_P2P_INVITE) { //P2P is different...they only have voice invitations notify_box_type = "VoiceInviteP2P"; + voice_invite = TRUE; } else if ( gAgent.isInGroup(session_id) ) { //only really old school groups have voice invitations notify_box_type = "VoiceInviteGroup"; question_type = "VoiceInviteQuestionGroup"; + voice_invite = TRUE; } else if ( inv_type == INVITATION_TYPE_VOICE ) { @@ -2542,6 +2546,7 @@ void LLIMMgr::inviteToSession( //and a voice ad-hoc notify_box_type = "VoiceInviteAdHoc"; ad_hoc_invite = TRUE; + voice_invite = TRUE; } else if ( inv_type == INVITATION_TYPE_IMMEDIATE ) { @@ -2565,13 +2570,12 @@ void LLIMMgr::inviteToSession( if (channelp && channelp->callStarted()) { // you have already started a call to the other user, so just accept the invite - LLNotifications::instance().forceResponse(LLNotification::Params("VoiceInviteP2P").payload(payload), 0); + LLIncomingCallDialog::processCallResponse(0, payload); return; } - if (type == IM_SESSION_P2P_INVITE || ad_hoc_invite) + if (voice_invite) { - if ( // if we're rejecting all incoming call requests gSavedSettings.getBOOL("VoiceCallsRejectAll") // or we're rejecting non-friend voice calls and this isn't a friend @@ -2579,7 +2583,7 @@ void LLIMMgr::inviteToSession( ) { // silently decline the call - LLNotifications::instance().forceResponse(LLNotification::Params("VoiceInviteP2P").payload(payload), 1); + LLIncomingCallDialog::processCallResponse(1, payload); return; } } -- cgit v1.2.3