From 81affe719ff4623a5332477db44b535a1e2b6e55 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Wed, 14 May 2014 03:34:32 -0400 Subject: [PATCH] Add a setting to automatically decline and leave incoming conferences Look under Communication preferences for "Block incoming conference chats" to activate. --- indra/newview/app_settings/settings.xml | 11 ++++++++ indra/newview/llimview.cpp | 28 +++++++++++++------ .../xui/en-us/panel_preferences_im.xml | 1 + 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 9fe7ca001..23b185b61 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -651,6 +651,17 @@ Value 0 + LiruBlockConferences + + Comment + When true, new incoming conference chats will not be opened. + Persist + 1 + Type + Boolean + Value + 0 + LiruContinueFlyingOnUnsit Comment diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 4a06dd1c8..0a213f1d6 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -448,8 +448,8 @@ void LLIMMgr::addMessage( // create IM window as necessary if(!floater) { - // Return now if we're blocking this group's chat - if (getIgnoreGroup(session_id) && gAgent.isInGroup(session_id)) + // Return now if we're blocking this group's chat or conferences + if (gAgent.isInGroup(session_id) ? getIgnoreGroup(session_id) : dialog != IM_NOTHING_SPECIAL && dialog != IM_SESSION_P2P_INVITE && gSavedSettings.getBOOL("LiruBlockConferences")) return; std::string name = (session_name.size() > 1) ? session_name : from; @@ -1423,6 +1423,17 @@ public: }; +void leave_group_chat(const LLUUID& from_id, const LLUUID& session_id) +{ + // Tell the server we've left group chat + std::string name; + gAgent.buildFullname(name); + pack_instant_message(gMessageSystem, gAgentID, false, gAgentSessionID, from_id, + name, LLStringUtil::null, IM_ONLINE, IM_SESSION_LEAVE, session_id); + gAgent.sendReliableMessage(); + gIMMgr->removeSession(session_id); +} + class LLViewerChatterBoxInvitation : public LLHTTPNode { public: @@ -1535,13 +1546,7 @@ public: { if (gIMMgr->getIgnoreGroup(session_id)) { - // Tell the server we've left group chat - std::string name; - gAgent.buildFullname(name); - pack_instant_message(gMessageSystem, gAgentID, false, gAgent.getSessionID(), from_id, - name, LLStringUtil::null, IM_ONLINE, IM_SESSION_LEAVE, session_id); - gAgent.sendReliableMessage(); - gIMMgr->removeSession(session_id); + leave_group_chat(from_id, session_id); return; } else if (gSavedSettings.getBOOL("OptionShowGroupNameInChatIM")) @@ -1555,6 +1560,11 @@ public: } else { + if (from_id != session_id && gSavedSettings.getBOOL("LiruBlockConferences")) // from and session are equal for IMs only. + { + leave_group_chat(from_id, session_id); + return; + } prepend_msg = std::string("IM: "); } chat.mText = prepend_msg + name + separator_string + saved + message.substr(message_offset); diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml index b3f801f14..a43d828f6 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml @@ -8,6 +8,7 @@ + Logging Options: