Option to block/reject all group invites, without the need to enable DND mode

meow-7.2.2
Northspring 2015-07-27 10:16:36 +02:00
parent feec3678f6
commit 8b5a070526
7 changed files with 118 additions and 4 deletions

View File

@ -176,6 +176,17 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>FSRejectAllGroupInvitesMode</key>
<map>
<key>Comment</key>
<string>Has the user selected reject all group invites mode?</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>FSRejectTeleportOffersMode</key>
<map>
<key>Comment</key>

View File

@ -403,6 +403,7 @@ LLAgent::LLAgent() :
mIsAutorespond(FALSE),
mIsAutorespondNonFriends(FALSE),
mIsRejectTeleportOffers(FALSE), // <FS:PP> FIRE-1245: Option to block/reject teleport offers
mIsRejectAllGroupInvites(FALSE), // <FS:PP> Option to block/reject all group invites
mAfkSitting(false), // <FS:Ansariel> FIRE-1568: Fix sit on AFK issues (standing up when sitting before)
// <FS> Ignore prejump and always fly
@ -514,6 +515,7 @@ void LLAgent::init()
selectAutorespond(gSavedPerAccountSettings.getBOOL("FSAutorespondMode"));
selectAutorespondNonFriends(gSavedPerAccountSettings.getBOOL("FSAutorespondNonFriendsMode"));
selectRejectTeleportOffers(gSavedPerAccountSettings.getBOOL("FSRejectTeleportOffersMode")); // <FS:PP> FIRE-1245: Option to block/reject teleport offers
selectRejectAllGroupInvites(gSavedPerAccountSettings.getBOOL("FSRejectAllGroupInvitesMode")); // <FS:PP> Option to block/reject all group invites
if (!mTeleportFinishedSlot.connected())
{
@ -1761,6 +1763,44 @@ BOOL LLAgent::getRejectTeleportOffers() const
// </FS:PP> FIRE-1245: Option to block/reject teleport offers
// <FS:PP> 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;
}
// </FS:PP> Option to block/reject all group invites
//-----------------------------------------------------------------------------
// startAutoPilotGlobal()
//-----------------------------------------------------------------------------

View File

@ -489,6 +489,16 @@ private:
BOOL mIsRejectTeleportOffers;
// </FS:PP> FIRE-1245: Option to block/reject teleport offers
// <FS:PP> Option to block/reject all group invites
public:
void setRejectAllGroupInvites();
void clearRejectAllGroupInvites();
void selectRejectAllGroupInvites(BOOL);
BOOL getRejectAllGroupInvites() const;
private:
BOOL mIsRejectAllGroupInvites;
// </FS:PP> Option to block/reject all group invites
//--------------------------------------------------------------------
// Grab
//--------------------------------------------------------------------

View File

@ -6965,6 +6965,34 @@ class LLWorldGetRejectTeleportOffers : public view_listener_t
};
// </FS:PP> FIRE-1245: Option to block/reject teleport offers
// <FS:PP> 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;
}
};
// </FS:PP> 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");
// </FS:PP>
// <FS:PP> FIRE-1245: Option to block/reject teleport requests
view_listener_t::addMenu(new LLWorldSetRejectAllGroupInvites(), "World.SetRejectAllGroupInvites");
view_listener_t::addMenu(new LLWorldGetRejectAllGroupInvites(), "World.GetRejectAllGroupInvites");
// </FS:PP>
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");

View File

@ -738,9 +738,15 @@ bool join_group_response(const LLSD& notification, const LLSD& response)
LLSD args;
args["MESSAGE"] = message;
// <FS:PP> 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;
}
// </FS:PP> Option to block/reject all group invites
// <FS:PP> 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"); // <FS:PP> Group invitation sound
// <FS:PP> 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;
}
// </FS:PP> Option to block/reject all group invites
// <FS:PP> 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"); // <FS:PP> Group invitation sound
LLNotificationsUtil::add("JoinGroupProtectionNotice", args, payload);
}
else
{
make_ui_sound("UISndGroupInvitation"); // <FS:PP> Group invitation sound
LLNotificationsUtil::add("JoinGroup", args, payload);
}
// </FS:PP>

View File

@ -503,6 +503,14 @@
<menu_item_check.on_click
function="World.SetRejectTeleportOffers"/>
</menu_item_check>
<menu_item_check
label="Reject all group invites"
name="Reject all group invites">
<menu_item_check.on_check
function="World.GetRejectAllGroupInvites"/>
<menu_item_check.on_click
function="World.SetRejectAllGroupInvites"/>
</menu_item_check>
</menu>

View File

@ -59,6 +59,7 @@
<menu_item_check label="Autoodpowiedź" name="Set Autorespond"/>
<menu_item_check label="Autoodpowiedź dla nieznajomych" name="Set Autorespond to non-friends"/>
<menu_item_check label="Odrzucaj propozycje i prośby o teleport" name="Automatically reject teleport offers"/>
<menu_item_check label="Odrzucaj zaproszenia do grup" name="Reject all group invites"/>
</menu>
<menu_item_call label="Znajomi" name="My Friends"/>
<menu_item_check label="Kontakty" name="Contacts"/>