From 3187ee18e1fa5a8b3f719f26f32b01b817791a4e Mon Sep 17 00:00:00 2001 From: PavelK ProductEngine Date: Wed, 15 May 2013 20:31:47 +0300 Subject: CHUI-945 FIXED Add Object IMs to Chat Notification Preferences --- indra/newview/app_settings/settings.xml | 105 +++++++++++++++- indra/newview/llfloaterpreference.cpp | 4 +- indra/newview/llimview.cpp | 35 +++++- indra/newview/llviewermessage.cpp | 1 + .../default/xui/en/panel_preferences_chat.xml | 140 +++++++++++++++++---- 5 files changed, 250 insertions(+), 35 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 03135caf93..5f1348e3c5 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6398,7 +6398,10 @@ NotificationConferenceIMOptions Comment - Specifies how the UI responds to Conference IM Notifications. + + Specifies how the UI responds to Conference IM Notifications. + Allowed values: [openconversations,toast,flash,noaction] + Persist 1 Type @@ -6409,7 +6412,10 @@ NotificationFriendIMOptions Comment - Specifies how the UI responds to Friend IM Notifications. + + Specifies how the UI responds to Friend IM Notifications. + Allowed values: [openconversations,toast,flash,noaction] + Persist 1 Type @@ -6420,7 +6426,10 @@ NotificationGroupChatOptions Comment - Specifies how the UI responds to Group Chat Notifications. + + Specifies how the UI responds to Group Chat Notifications. + Allowed values: [openconversations,toast,flash,noaction] + Persist 1 Type @@ -6431,7 +6440,10 @@ NotificationNearbyChatOptions Comment - Specifies how the UI responds to Nearby Chat Notifications. + + Specifies how the UI responds to Nearby Chat Notifications. + Allowed values: [openconversations,toast,flash,noaction] + Persist 1 Type @@ -6442,7 +6454,10 @@ NotificationNonFriendIMOptions Comment - Specifies how the UI responds to Non Friend IM Notifications. + + Specifies how the UI responds to Non Friend IM Notifications. + Allowed values: [openconversations,toast,flash,noaction] + Persist 1 Type @@ -6450,6 +6465,20 @@ Value toast + NotificationObjectIMOptions + + Comment + + Specifies how the UI responds to Object IM Notifications. + Allowed values: [openconversations,toast,flash,noaction] + + Persist + 1 + Type + String + Value + noaction + NotificationToastLifeTime Comment @@ -6988,6 +7017,72 @@ Value 0 + PlaySoundFriendIM + + Comment + Plays a sound when friend's IM received. + Persist + 1 + Type + Boolean + Value + 0 + + PlaySoundNonFriendIM + + Comment + Plays a sound when non-friend's IM received. + Persist + 1 + Type + Boolean + Value + 0 + + PlaySoundConferenceIM + + Comment + Plays a sound when conference IM received. + Persist + 1 + Type + Boolean + Value + 0 + + PlaySoundGroupChatIM + + Comment + Plays a sound when group chat IM received. + Persist + 1 + Type + Boolean + Value + 0 + + PlaySoundNearbyChatIM + + Comment + Plays a sound when nearby chat IM received. + Persist + 1 + Type + Boolean + Value + 0 + + PlaySoundObjectIM + + Comment + Plays a sound when IM fom an object received. + Persist + 1 + Type + Boolean + Value + 0 + PlaySoundNewConversation Comment diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index bbf88060c1..7ada4cfd00 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -452,6 +452,7 @@ BOOL LLFloaterPreference::postBuild() getChild("ConferenceIMOptions")->setCommitCallback(boost::bind(&LLFloaterPreference::onNotificationsChange, this,"ConferenceIMOptions")); getChild("GroupChatOptions")->setCommitCallback(boost::bind(&LLFloaterPreference::onNotificationsChange, this,"GroupChatOptions")); getChild("NearbyChatOptions")->setCommitCallback(boost::bind(&LLFloaterPreference::onNotificationsChange, this,"NearbyChatOptions")); + getChild("ObjectIMOptions")->setCommitCallback(boost::bind(&LLFloaterPreference::onNotificationsChange, this,"ObjectIMOptions")); // if floater is opened before login set default localized do not disturb message if (LLStartUp::getStartupState() < STATE_STARTED) @@ -721,6 +722,7 @@ void LLFloaterPreference::onOpen(const LLSD& key) onNotificationsChange("ConferenceIMOptions"); onNotificationsChange("GroupChatOptions"); onNotificationsChange("NearbyChatOptions"); + onNotificationsChange("ObjectIMOptions"); LLPanelLogin::setAlwaysRefresh(true); refresh(); @@ -928,7 +930,7 @@ void LLFloaterPreference::onNotificationsChange(const std::string& OptionName) bool show_notifications_alert = true; for (notifications_map::iterator it_notification = mNotificationOptions.begin(); it_notification != mNotificationOptions.end(); it_notification++) { - if(it_notification->second != "None") + if(it_notification->second != "No action") { show_notifications_alert = false; break; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index ff163f5b25..892038722d 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -196,32 +196,63 @@ void notify_of_message(const LLSD& msg, bool is_dnd_msg) // determine user prefs for this session if (session_id.isNull()) { - user_preferences = gSavedSettings.getString("NotificationNearbyChatOptions"); + if (msg["source_type"].asInteger() == CHAT_SOURCE_OBJECT) + { + user_preferences = gSavedSettings.getString("NotificationObjectIMOptions"); + if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundObjectIM") == TRUE)) + { + make_ui_sound("UISndNewIncomingIMSession"); + } + } + else + { + user_preferences = gSavedSettings.getString("NotificationNearbyChatOptions"); + if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundNearbyChatIM") == TRUE)) + { + make_ui_sound("UISndNewIncomingIMSession"); + } + } } else if(session->isP2PSessionType()) { if (LLAvatarTracker::instance().isBuddy(participant_id)) { user_preferences = gSavedSettings.getString("NotificationFriendIMOptions"); + if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundFriendIM") == TRUE)) + { + make_ui_sound("UISndNewIncomingIMSession"); + } } else { user_preferences = gSavedSettings.getString("NotificationNonFriendIMOptions"); + if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundNonFriendIM") == TRUE)) + { + make_ui_sound("UISndNewIncomingIMSession"); + } } } else if(session->isAdHocSessionType()) { user_preferences = gSavedSettings.getString("NotificationConferenceIMOptions"); + if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundConferenceIM") == TRUE)) + { + make_ui_sound("UISndNewIncomingIMSession"); + } } else if(session->isGroupSessionType()) { user_preferences = gSavedSettings.getString("NotificationGroupChatOptions"); + if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundGroupChatIM") == TRUE)) + { + make_ui_sound("UISndNewIncomingIMSession"); + } } // actions: // 0. nothing - exit - if (("none" == user_preferences || + if (("noaction" == user_preferences || ON_TOP_AND_ITEM_IS_SELECTED == conversations_floater_status) && session_floater->isMessagePaneExpanded()) { diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 3a57e2a3c9..013d8c86f8 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3666,6 +3666,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) LLSD msg_notify = LLSD(LLSD::emptyMap()); msg_notify["session_id"] = LLUUID(); msg_notify["from_id"] = chat.mFromID; + msg_notify["source_type"] = chat.mSourceType; on_new_message(msg_notify); } } diff --git a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml index bd096ebb88..2fd26e3f01 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml @@ -100,14 +100,6 @@ left="13" width="517"> - - Notifications - + label="No action" + name="NoAction" + value="noaction"/> + + + top_pad="11"> Non-friend IMs: + label="No action" + name="NoAction" + value="noaction"/> + + + top_pad="11"> Conference IMs: + label="No action" + name="NoAction" + value="noaction"/> + + + top_pad="11"> Group chat: + label="No action" + name="NoAction" + value="noaction"/> + + + top_pad="11"> Nearby chat: + label="No action" + name="NoAction" + value="noaction"/> + + + + Object IMs: + + + + + + + + +