diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloaterimnearbychathandler.cpp | 44 | ||||
-rw-r--r-- | indra/newview/llimview.cpp | 80 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_preferences_chat.xml | 20 |
3 files changed, 87 insertions, 57 deletions
diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp index ab81b85d04..d9c461e836 100644 --- a/indra/newview/llfloaterimnearbychathandler.cpp +++ b/indra/newview/llfloaterimnearbychathandler.cpp @@ -41,6 +41,7 @@ #include "llfloaterreg.h"//for LLFloaterReg::getTypedInstance #include "llviewerwindow.h"//for screen channel position #include "llfloaterimnearbychat.h" +#include "llfloaterimcontainer.h" #include "llrootview.h" #include "lllayoutstack.h" @@ -283,12 +284,6 @@ bool LLFloaterIMNearbyChatScreenChannel::createPoolToast() void LLFloaterIMNearbyChatScreenChannel::addChat(LLSD& chat) { - //Ignore Nearby Toasts - if(gSavedSettings.getString("NotificationNearbyChatOptions") != "toast") - { - return; - } - //look in pool. if there is any message if(mStopProcessing) return; @@ -606,19 +601,30 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg, toast_msg = chat_msg.mText; } - // Add a nearby chat toast. - LLUUID id; - id.generate(); - chat["id"] = id; - std::string r_color_name = "White"; - F32 r_color_alpha = 1.0f; - LLViewerChat::getChatColor( chat_msg, r_color_name, r_color_alpha); - - chat["text_color"] = r_color_name; - chat["color_alpha"] = r_color_alpha; - chat["font_size"] = (S32)LLViewerChat::getChatFontSize() ; - chat["message"] = toast_msg; - channel->addChat(chat); + + //Will show toast when chat preference is set + if(gSavedSettings.getString("NotificationNearbyChatOptions") == "toast") + { + // Add a nearby chat toast. + LLUUID id; + id.generate(); + chat["id"] = id; + std::string r_color_name = "White"; + F32 r_color_alpha = 1.0f; + LLViewerChat::getChatColor( chat_msg, r_color_name, r_color_alpha); + + chat["text_color"] = r_color_name; + chat["color_alpha"] = r_color_alpha; + chat["font_size"] = (S32)LLViewerChat::getChatFontSize() ; + chat["message"] = toast_msg; + channel->addChat(chat); + } + //Will show Conversations floater when chat preference is set + else if(gSavedSettings.getString("NotificationNearbyChatOptions") == "openconversations") + { + LLFloaterReg::showInstance("im_container"); + } + } } diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index db52a50aa1..581043a3d0 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -116,79 +116,83 @@ static void on_avatar_name_cache_toast(const LLUUID& agent_id, void on_new_message(const LLSD& msg) { - std::string action; - LLUUID participant_id = msg["from_id"].asUUID(); - LLUUID session_id = msg["session_id"].asUUID(); + std::string action; + LLUUID participant_id = msg["from_id"].asUUID(); + LLUUID session_id = msg["session_id"].asUUID(); LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(session_id); // determine action for this session if (session_id.isNull()) { - action = gSavedSettings.getString("NotificationNearbyChatOptions"); + action = gSavedSettings.getString("NotificationNearbyChatOptions"); } else if(session->isP2PSessionType()) { if (LLAvatarTracker::instance().isBuddy(participant_id)) { - action = gSavedSettings.getString("NotificationFriendIMOptions"); + action = gSavedSettings.getString("NotificationFriendIMOptions"); } else { - action = gSavedSettings.getString("NotificationNonFriendIMOptions"); + action = gSavedSettings.getString("NotificationNonFriendIMOptions"); } } else if(session->isAdHocSessionType()) { - action = gSavedSettings.getString("NotificationConferenceIMOptions"); + action = gSavedSettings.getString("NotificationConferenceIMOptions"); } else if(session->isGroupSessionType()) { - action = gSavedSettings.getString("NotificationGroupChatOptions"); + action = gSavedSettings.getString("NotificationGroupChatOptions"); } - // do not show notification in "do not disturb" mode or it goes from agent - if (gAgent.isDoNotDisturb() || gAgent.getID() == participant_id) - { - return; - } + // do not show notification in "do not disturb" mode or it goes from agent + if (gAgent.isDoNotDisturb() || gAgent.getID() == participant_id) + { + return; + } - // execution of the action + // execution of the action - if ("toast" == action) - { - // Skip toasting if we have open window of IM with this session id + if ("toast" == action) + { + // Skip toasting if we have open window of IM with this session id LLFloaterIMSession* open_im_floater = LLFloaterIMSession::findInstance(session_id); if ( - open_im_floater - && open_im_floater->isInVisibleChain() - && open_im_floater->hasFocus() - && !open_im_floater->isMinimized() - && !(open_im_floater->getHost() - && open_im_floater->getHost()->isMinimized()) - ) + open_im_floater + && open_im_floater->isInVisibleChain() + && open_im_floater->hasFocus() + && !open_im_floater->isMinimized() + && !(open_im_floater->getHost() + && open_im_floater->getHost()->isMinimized()) + ) { return; } - // Skip toasting for system messages - if (participant_id.isNull()) - { - return; - } + // Skip toasting for system messages + if (participant_id.isNull()) + { + return; + } //Show toast - LLAvatarNameCache::get(participant_id, boost::bind(&on_avatar_name_cache_toast, _1, _2, msg)); - } - else if ("flash" == action) - { - LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container"); - if (im_box) + LLAvatarNameCache::get(participant_id, boost::bind(&on_avatar_name_cache_toast, _1, _2, msg)); + } + else if ("flash" == action) + { + LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container"); + if (im_box) { - im_box->flashConversationItemWidget(session_id, true); // flashing of the conversation's item + im_box->flashConversationItemWidget(session_id, true); // flashing of the conversation's item } gToolBarView->flashCommand(LLCommandId("chat"), true); // flashing of the FUI button "Chat" - } + } + else if("openconversations" == action) + { + LLFloaterReg::showInstance("im_container"); + } } LLIMModel::LLIMModel() @@ -1725,7 +1729,7 @@ BOOL LLCallDialog::postBuild() return FALSE; dockToToolbarButton("speak"); - + return TRUE; } 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 712e8bff7f..0c94b6b223 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml @@ -135,6 +135,10 @@ name="FriendIMOptions" width="223"> <combo_box.item + label="Open Conversations window" + name="OpenConversationsWindow" + value="openconversations"/> + <combo_box.item label="Pop up the message" name="PopUpMessage" value="toast"/> @@ -166,6 +170,10 @@ name="NonFriendIMOptions" width="223"> <combo_box.item + label="Open Conversations window" + name="OpenConversationsWindow" + value="openconversations"/> + <combo_box.item label="Pop up the message" name="PopUpMessage" value="toast"/> @@ -197,6 +205,10 @@ name="ConferenceIMOptions" width="223"> <combo_box.item + label="Open Conversations window" + name="OpenConversationsWindow" + value="openconversations"/> + <combo_box.item label="Pop up the message" name="PopUpMessage" value="toast"/> @@ -228,6 +240,10 @@ name="GroupChatOptions" width="223"> <combo_box.item + label="Open Conversations window" + name="OpenConversationsWindow" + value="openconversations"/> + <combo_box.item label="Pop up the message" name="PopUpMessage" value="toast"/> @@ -259,6 +275,10 @@ name="NearbyChatOptions" width="223"> <combo_box.item + label="Open Conversations window" + name="OpenConversationsWindow" + value="openconversations"/> + <combo_box.item label="Pop up the message" name="PopUpMessage" value="toast"/> |