summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorWilliam Todd Stinson <stinson@lindenlab.com>2012-11-15 19:08:08 -0800
committerWilliam Todd Stinson <stinson@lindenlab.com>2012-11-15 19:08:08 -0800
commit568d818ffe214c358f92717ceb86dd20cb4aed26 (patch)
tree6bd525c639a03f2fd9d4280370c5e04ae0fb5cf9 /indra/newview
parent37d7f469055d3ba4b81815fa2ac8459022e1e3cf (diff)
CHUI-518: WIP First pass as implementing auto-reject voice calls in do not disturb mode.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llimview.cpp16
-rwxr-xr-xindra/newview/llviewermessage.cpp4
-rw-r--r--indra/newview/llviewermessage.h2
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml1
-rw-r--r--indra/newview/skins/default/xui/en/strings.xml3
5 files changed, 17 insertions, 9 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 0bb370e6fe..50e2b48f30 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -64,6 +64,7 @@
#include "lltoolbarview.h"
#include "llviewercontrol.h"
#include "llviewerparcelmgr.h"
+#include "message.h"
const static std::string ADHOC_NAME_SUFFIX(" Conference");
@@ -2801,12 +2802,17 @@ void LLIMMgr::inviteToSession(
if (voice_invite)
{
- if ( // if we are rejecting group calls
- (gSavedSettings.getBOOL("VoiceCallsRejectGroup") && notify_box_type == "VoiceInviteGroup") ||
- // or we're rejecting non-friend voice calls and this isn't a friend
- (gSavedSettings.getBOOL("VoiceCallsFriendsOnly") && (LLAvatarTracker::instance().getBuddyInfo(caller_id) == NULL))
- )
+ bool isRejectGroupCall = (gSavedSettings.getBOOL("VoiceCallsRejectGroup") && (notify_box_type == "VoiceInviteGroup"));
+ bool isRejectNonFriendCall = (gSavedSettings.getBOOL("VoiceCallsFriendsOnly") && (LLAvatarTracker::instance().getBuddyInfo(caller_id) == NULL));
+ bool isRejectDoNotDisturb = gAgent.isDoNotDisturb();
+ if (isRejectGroupCall || isRejectNonFriendCall || isRejectDoNotDisturb)
{
+ if (isRejectDoNotDisturb && !isRejectGroupCall && !isRejectNonFriendCall)
+ {
+ LLSD args;
+ LLIMMgr::getInstance()->addSystemMessage(session_id, "you_auto_rejected_call", args);
+ send_do_not_disturb_message(gMessageSystem, caller_id, session_id);
+ }
// silently decline the call
LLIncomingCallDialog::processCallResponse(1, payload);
return;
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 56c9f81259..e21db146db 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -179,8 +179,6 @@ const BOOL SCRIPT_QUESTION_IS_CAUTION[SCRIPT_PERMISSION_EOF] =
FALSE // TeleportYourAgent
};
-static void send_do_not_disturb_message (LLMessageSystem* msg, const LLUUID& from_id, const LLUUID& session_id = LLUUID::null);
-
bool friendship_offer_callback(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
@@ -3240,7 +3238,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
}
}
-static void send_do_not_disturb_message (LLMessageSystem* msg, const LLUUID& from_id, const LLUUID& session_id)
+void send_do_not_disturb_message (LLMessageSystem* msg, const LLUUID& from_id, const LLUUID& session_id)
{
if (gAgent.isDoNotDisturb())
{
diff --git a/indra/newview/llviewermessage.h b/indra/newview/llviewermessage.h
index b298f0060b..447fdeb9c7 100644
--- a/indra/newview/llviewermessage.h
+++ b/indra/newview/llviewermessage.h
@@ -152,6 +152,8 @@ void send_group_notice(const LLUUID& group_id,
const std::string& message,
const LLInventoryItem* item);
+void send_do_not_disturb_message (LLMessageSystem* msg, const LLUUID& from_id, const LLUUID& session_id = LLUUID::null);
+
void handle_lure(const LLUUID& invitee);
void handle_lure(const uuid_vec_t& ids);
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 6c2ad869ac..eaa020ff49 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -3695,6 +3695,7 @@ Do Not Disturb is on. You will not be notified of incoming communications.
- Other residents will receive your Do Not Disturb response (set in Preferences &gt; General).
- Teleportation offers will be declined.
+- Voice calls will be rejected.
- Inventory offers will go to your Trash.
<usetemplate
ignoretext="I change my status to Do Not Disturb mode"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 8489e8ca0f..18b914c764 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -3384,7 +3384,8 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
<string name="answered_call">Your call has been answered</string>
<string name="you_started_call">You started a voice call</string>
<string name="you_joined_call">You joined the voice call</string>
- <string name="name_started_call">[NAME] started a voice call</string>
+ <string name="you_auto_rejected_call-im">You automatically rejected the voice call while &apos;Do Not Disturb&apos; was on.</string>
+ <string name="name_started_call">[NAME] started a voice call</string>
<string name="ringing-im">
Joining voice call...