From 8b5a070526e5ff1297d81cb62be3ba0dffe28ea1 Mon Sep 17 00:00:00 2001 From: Northspring Date: Mon, 27 Jul 2015 10:16:36 +0200 Subject: [PATCH] Option to block/reject all group invites, without the need to enable DND mode --- .../app_settings/settings_per_account.xml | 11 +++++ indra/newview/llagent.cpp | 40 +++++++++++++++++++ indra/newview/llagent.h | 10 +++++ indra/newview/llviewermenu.cpp | 32 +++++++++++++++ indra/newview/llviewermessage.cpp | 20 ++++++++-- .../skins/default/xui/en/menu_viewer.xml | 8 ++++ .../skins/default/xui/pl/menu_viewer.xml | 1 + 7 files changed, 118 insertions(+), 4 deletions(-) diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index ff90415a72..a3129f7eac 100755 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -176,6 +176,17 @@ Value 0 + FSRejectAllGroupInvitesMode + + Comment + Has the user selected reject all group invites mode? + Persist + 1 + Type + Boolean + Value + 0 + FSRejectTeleportOffersMode Comment diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 4327bad1c5..0971ec3146 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -403,6 +403,7 @@ LLAgent::LLAgent() : mIsAutorespond(FALSE), mIsAutorespondNonFriends(FALSE), mIsRejectTeleportOffers(FALSE), // FIRE-1245: Option to block/reject teleport offers + mIsRejectAllGroupInvites(FALSE), // Option to block/reject all group invites mAfkSitting(false), // FIRE-1568: Fix sit on AFK issues (standing up when sitting before) // Ignore prejump and always fly @@ -514,6 +515,7 @@ void LLAgent::init() selectAutorespond(gSavedPerAccountSettings.getBOOL("FSAutorespondMode")); selectAutorespondNonFriends(gSavedPerAccountSettings.getBOOL("FSAutorespondNonFriendsMode")); selectRejectTeleportOffers(gSavedPerAccountSettings.getBOOL("FSRejectTeleportOffersMode")); // FIRE-1245: Option to block/reject teleport offers + selectRejectAllGroupInvites(gSavedPerAccountSettings.getBOOL("FSRejectAllGroupInvitesMode")); // Option to block/reject all group invites if (!mTeleportFinishedSlot.connected()) { @@ -1761,6 +1763,44 @@ BOOL LLAgent::getRejectTeleportOffers() const // FIRE-1245: Option to block/reject teleport offers +// Option to block/reject all group invites + +//----------------------------------------------------------------------------- +// setRejectAllGroupInvites() +//----------------------------------------------------------------------------- +void LLAgent::setRejectAllGroupInvites() +{ + selectRejectAllGroupInvites(TRUE); +} + +//----------------------------------------------------------------------------- +// clearRejectAllGroupInvites() +//----------------------------------------------------------------------------- +void LLAgent::clearRejectAllGroupInvites() +{ + selectRejectAllGroupInvites(FALSE); +} + +//----------------------------------------------------------------------------- +// selectRejectAllGroupInvites() +//----------------------------------------------------------------------------- +void LLAgent::selectRejectAllGroupInvites(BOOL selected) +{ + LL_INFOS() << "Setting rejecting group invites mode to " << selected << LL_ENDL; + mIsRejectAllGroupInvites = selected; + gSavedPerAccountSettings.setBOOL("FSRejectAllGroupInvitesMode", selected); +} + +//----------------------------------------------------------------------------- +// getRejectAllGroupInvites() +//----------------------------------------------------------------------------- +BOOL LLAgent::getRejectAllGroupInvites() const +{ + return mIsRejectAllGroupInvites; +} + +// Option to block/reject all group invites + //----------------------------------------------------------------------------- // startAutoPilotGlobal() //----------------------------------------------------------------------------- diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 562d798b34..937e236460 100755 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -489,6 +489,16 @@ private: BOOL mIsRejectTeleportOffers; // FIRE-1245: Option to block/reject teleport offers +// Option to block/reject all group invites +public: + void setRejectAllGroupInvites(); + void clearRejectAllGroupInvites(); + void selectRejectAllGroupInvites(BOOL); + BOOL getRejectAllGroupInvites() const; +private: + BOOL mIsRejectAllGroupInvites; +// Option to block/reject all group invites + //-------------------------------------------------------------------- // Grab //-------------------------------------------------------------------- diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index e2e6ec8770..5ff8d4a80e 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -6965,6 +6965,34 @@ class LLWorldGetRejectTeleportOffers : public view_listener_t }; // FIRE-1245: Option to block/reject teleport offers +// Option to block/reject all group invites +class LLWorldSetRejectAllGroupInvites : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + if (gAgent.getRejectAllGroupInvites()) + { + gAgent.clearRejectAllGroupInvites(); + } + else + { + gAgent.setRejectAllGroupInvites(); + } + return true; + } +}; + +// [SJ - FIRE-2177 - Making Autorespons a simple Check in the menu again for clarity] +class LLWorldGetRejectAllGroupInvites : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool new_value = gAgent.getRejectAllGroupInvites(); + return new_value; + } +}; +// Option to block/reject all group invites + class LLWorldCreateLandmark : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -10711,6 +10739,10 @@ void initialize_menus() view_listener_t::addMenu(new LLWorldSetRejectTeleportOffers(), "World.SetRejectTeleportOffers"); view_listener_t::addMenu(new LLWorldGetRejectTeleportOffers(), "World.GetRejectTeleportOffers"); // + // FIRE-1245: Option to block/reject teleport requests + view_listener_t::addMenu(new LLWorldSetRejectAllGroupInvites(), "World.SetRejectAllGroupInvites"); + view_listener_t::addMenu(new LLWorldGetRejectAllGroupInvites(), "World.GetRejectAllGroupInvites"); + // view_listener_t::addMenu(new LLWorldSetAutorespondNonFriends(), "World.SetAutorespondNonFriends"); view_listener_t::addMenu(new LLWorldGetAutorespondNonFriends(), "World.GetAutorespondNonFriends"); //[SJ FIRE-2177] view_listener_t::addMenu(new LLWorldEnableCreateLandmark(), "World.EnableCreateLandmark"); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index b218334f29..55cbb93343 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -738,9 +738,15 @@ bool join_group_response(const LLSD& notification, const LLSD& response) LLSD args; args["MESSAGE"] = message; + // Option to block/reject all group invites + if (gSavedPerAccountSettings.getBOOL("FSRejectAllGroupInvitesMode")) + { + LL_INFOS("Messaging") << "Group invite automatically rejected because of the user setting..." << LL_ENDL; + } + // Option to block/reject all group invites // FIRE-11181: Option to remove the "Join" button from group invites that include enrollment fees // LLNotificationsUtil::add("JoinGroup", args, notification_adjusted["payload"]); - if(fee > 0 && gSavedSettings.getBOOL("FSAllowGroupInvitationOnlyWithoutFee")) + else if (fee > 0 && gSavedSettings.getBOOL("FSAllowGroupInvitationOnlyWithoutFee")) { LLNotificationsUtil::add("JoinGroupProtectionNotice", args, notification_adjusted["payload"]); } @@ -3362,16 +3368,22 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) args["MESSAGE"] = message; // we shouldn't pass callback functor since it is registered in LLFunctorRegistration - make_ui_sound("UISndGroupInvitation"); // Group invitation sound - + // Option to block/reject all group invites + if (gSavedPerAccountSettings.getBOOL("FSRejectAllGroupInvitesMode")) + { + LL_INFOS("Messaging") << "Group invite automatically rejected because of the user setting..." << LL_ENDL; + } + // Option to block/reject all group invites // FIRE-11181: Option to remove the "Join" button from group invites that include enrollment fees // LLNotificationsUtil::add("JoinGroup", args, payload); - if(membership_fee > 0 && gSavedSettings.getBOOL("FSAllowGroupInvitationOnlyWithoutFee")) + else if (membership_fee > 0 && gSavedSettings.getBOOL("FSAllowGroupInvitationOnlyWithoutFee")) { + make_ui_sound("UISndGroupInvitation"); // Group invitation sound LLNotificationsUtil::add("JoinGroupProtectionNotice", args, payload); } else { + make_ui_sound("UISndGroupInvitation"); // Group invitation sound LLNotificationsUtil::add("JoinGroup", args, payload); } // diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 09424aa54b..f20b337c32 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -503,6 +503,14 @@ + + + + diff --git a/indra/newview/skins/default/xui/pl/menu_viewer.xml b/indra/newview/skins/default/xui/pl/menu_viewer.xml index 40e4f70f50..7eaf87d8f3 100755 --- a/indra/newview/skins/default/xui/pl/menu_viewer.xml +++ b/indra/newview/skins/default/xui/pl/menu_viewer.xml @@ -59,6 +59,7 @@ +