Add an antispam setting to block only group invites to groups that require an entry fee.

This commit is contained in:
Shyotl
2012-09-27 19:30:54 -05:00
parent 88482a2431
commit ac0a32e690
5 changed files with 35 additions and 19 deletions

View File

@@ -973,6 +973,17 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>AntiSpamGroupFeeInvites</key>
<map>
<key>Comment</key>
<string>When true, dialogs from group invites that require an entry fee will be blocked.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>AntiSpamGroupNotices</key>
<map>
<key>Comment</key>

View File

@@ -367,6 +367,7 @@ void LLPrefsAscentChat::refreshValues()
mBlockAlertSpam = gSavedSettings.getBOOL("AntiSpamAlerts");
mBlockFriendSpam = gSavedSettings.getBOOL("AntiSpamFriendshipOffers");
mBlockGroupInviteSpam = gSavedSettings.getBOOL("AntiSpamGroupInvites");
mBlockGroupFeeInviteSpam = gSavedSettings.getBOOL("AntiSpamGroupFeeInvites");
mBlockGroupNoticeSpam = gSavedSettings.getBOOL("AntiSpamGroupNotices");
mBlockItemOfferSpam = gSavedSettings.getBOOL("AntiSpamItemOffers");
mBlockScriptSpam = gSavedSettings.getBOOL("AntiSpamScripts");
@@ -583,6 +584,7 @@ void LLPrefsAscentChat::cancel()
gSavedSettings.setBOOL("AntiSpamFriendshipOffers", mBlockFriendSpam);
gSavedSettings.setBOOL("AntiSpamGroupNotices", mBlockGroupNoticeSpam);
gSavedSettings.setBOOL("AntiSpamGroupInvites", mBlockGroupInviteSpam);
gSavedSettings.setBOOL("AntiSpamGroupFeeInvites", mBlockGroupFeeInviteSpam);
gSavedSettings.setBOOL("AntiSpamItemOffers", mBlockItemOfferSpam);
gSavedSettings.setBOOL("AntiSpamScripts", mBlockScriptSpam);
gSavedSettings.setBOOL("AntiSpamTeleports", mBlockTeleportSpam);

View File

@@ -96,6 +96,7 @@ protected:
BOOL mBlockFriendSpam;
BOOL mBlockGroupNoticeSpam;
BOOL mBlockGroupInviteSpam;
BOOL mBlockGroupFeeInviteSpam;
BOOL mBlockItemOfferSpam;
BOOL mBlockScriptSpam;
BOOL mBlockTeleportSpam;

View File

@@ -2557,8 +2557,25 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
break;
case IM_GROUP_INVITATION:
{
// Read the binary bucket for more information.
struct invite_bucket_t
{
S32 membership_fee;
LLUUID role_id;
}* invite_bucket;
// Make sure the binary bucket is the correct size.
if (binary_bucket_size != sizeof(invite_bucket_t))
{
LL_WARNS("Messaging") << "Malformed group invite binary bucket" << LL_ENDL;
break;
}
invite_bucket = (struct invite_bucket_t*) &binary_bucket[0];
S32 membership_fee = ntohl(invite_bucket->membership_fee);
// NaCl - Antispam
if(antispam || gSavedSettings.getBOOL("AntiSpamGroupInvites"))
if(antispam || gSavedSettings.getBOOL("AntiSpamGroupInvites") || (membership_fee > 0 && gSavedSettings.getBOOL("AntiSpamGroupFeeInvites")))
return;
// NaCl End
//if (!is_linden && (is_busy || is_muted))
@@ -2570,22 +2587,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
else
{
LL_INFOS("Messaging") << "Received IM_GROUP_INVITATION message." << LL_ENDL;
// Read the binary bucket for more information.
struct invite_bucket_t
{
S32 membership_fee;
LLUUID role_id;
}* invite_bucket;
// Make sure the binary bucket is the correct size.
if (binary_bucket_size != sizeof(invite_bucket_t))
{
LL_WARNS("Messaging") << "Malformed group invite binary bucket" << LL_ENDL;
break;
}
invite_bucket = (struct invite_bucket_t*) &binary_bucket[0];
S32 membership_fee = ntohl(invite_bucket->membership_fee);
LLSD payload;
payload["transaction_id"] = session_id;

View File

@@ -81,11 +81,12 @@
<text name="Block All Dialogs From" left="10" bottom_delta="-10">Block All Dialogs From</text>
<check_box control_name="AntiSpamAlerts" height="16" label="Alerts" name="Alerts" left="14" bottom_delta="-23"/>
<check_box control_name="AntiSpamFriendshipOffers" height="16" label="Friendship Offers" name="Friendship Offers" bottom_delta="0" left_delta="120"/>
<check_box control_name="AntiSpamGroupInvites" height="16" label="Group Invites" name="Group Invites" bottom_delta="0" left_delta="120"/>
<check_box control_name="AntiSpamGroupNotices" height="16" label="Group Notices" name="Group Notices" bottom_delta="0" left_delta="120"/>
<check_box control_name="AntiSpamGroupInvites" height="16" label="All Group Invites" name="Group Invites" bottom_delta="0" left_delta="120"/>
<check_box control_name="AntiSpamGroupFeeInvites" height="16" label="Group Fee Invites" name="Group Fee Invites" bottom_delta="0" left_delta="120"/>
<check_box control_name="AntiSpamItemOffers" height="16" label="Item Offers" name="Item Offers" left="14"/>
<check_box control_name="AntiSpamScripts" height="16" label="Scripts" name="Scripts" bottom_delta="0" left_delta="120"/>
<check_box control_name="AntiSpamTeleports" height="16" label="Teleport Offers" name="Teleport Offers" bottom_delta="0" left_delta="120"/>
<check_box control_name="AntiSpamGroupNotices" height="16" label="Group Notices" name="Group Notices" bottom_delta="0" left_delta="120"/>
</panel>
<panel border="true" bottom="-580" height="525" label="Text Options" left="1" name="TextOptions" width="418">