Made AntiSpam better

AntiSpamNotify setting to turn off notifications, which seemed to become a new form of spam, otherwise.
Add tool_tips to UI explaining how to make the system less sensitive.
Made defaults for antispam a lot less sensitive, so users used to the old antispam defaults won't likely need to configure the new panel.
Pull in license from NaCl... (Why wasn't it already there, Ruby?!)
Fixed spaces being where tabs should be...
Added in selective Dialog disabling, instead of just all, nice little feature in itself.
Potentially fixed a bug where sounds would be blocked when they shouldn't be... but, if this still happens, I'll put in a debug setting to disable sound antispam.
This commit is contained in:
Lirusaito
2012-07-25 09:03:41 -04:00
parent 89be317a00
commit 3190814265
7 changed files with 311 additions and 135 deletions

View File

@@ -95,6 +95,7 @@ LLPrefsAscentChat::LLPrefsAscentChat()
childSetEnabled("reset_antispam", started);
childSetCommitCallback("reset_antispam", onCommitResetAS, this);
childSetCommitCallback("antispam_checkbox", onCommitDialogBlock, this);
childSetCommitCallback("KeywordsOn", onCommitKeywords, this);
childSetCommitCallback("KeywordsList", onCommitKeywords, this);
@@ -248,6 +249,21 @@ void LLPrefsAscentChat::onCommitResetAS(LLUICtrl*, void*)
NACLAntiSpamRegistry::purgeAllQueues();
}
//static
void LLPrefsAscentChat::onCommitDialogBlock(LLUICtrl* ctrl, void* user_data)
{
LLPrefsAscentChat* self = (LLPrefsAscentChat*)user_data;
bool enabled = ctrl->getValue().asBoolean();
self->childSetEnabled("Block All Dialogs From", !enabled);
self->childSetEnabled("Alerts", !enabled);
self->childSetEnabled("Friendship Offers", !enabled);
self->childSetEnabled("Group Invites", !enabled);
self->childSetEnabled("Group Notices", !enabled);
self->childSetEnabled("Item Offers", !enabled);
self->childSetEnabled("Scripts", !enabled);
self->childSetEnabled("Teleport Offers", !enabled);
}
//static
void LLPrefsAscentChat::onCommitKeywords(LLUICtrl* ctrl, void* user_data)
{
@@ -331,6 +347,14 @@ void LLPrefsAscentChat::refreshValues()
mChatSpamCount = gSavedSettings.getU32("_NACL_AntiSpamAmount");
mChatSpamTime = gSavedSettings.getU32("_NACL_AntiSpamTime");
mBlockDialogSpam = gSavedSettings.getBOOL("_NACL_Antispam");
mBlockAlertSpam = gSavedSettings.getBOOL("AntiSpamAlerts");
mBlockFriendSpam = gSavedSettings.getBOOL("AntiSpamFriendshipOffers");
mBlockGroupInviteSpam = gSavedSettings.getBOOL("AntiSpamGroupInvites");
mBlockGroupNoticeSpam = gSavedSettings.getBOOL("AntiSpamGroupNotices");
mBlockItemOfferSpam = gSavedSettings.getBOOL("AntiSpamItemOffers");
mBlockScriptSpam = gSavedSettings.getBOOL("AntiSpamScripts");
mBlockTeleportSpam = gSavedSettings.getBOOL("AntiSpamTeleports");
mNotifyOnSpam = gSavedSettings.getBOOL("AntiSpamNotify");
mSoundMulti = gSavedSettings.getU32("_NACL_AntiSpamSoundMulti");
mNewLines = gSavedSettings.getU32("_NACL_AntiSpamNewlines");
mPreloadMulti = gSavedSettings.getU32("_NACL_AntiSpamSoundPreloadMulti");
@@ -378,6 +402,16 @@ void LLPrefsAscentChat::refresh()
LLWStringUtil::replaceChar(auto_response, '%', ' ');
childSetText("im_response", wstring_to_utf8str(auto_response));
//Antispam ------------------------------------------------------------------------
childSetEnabled("Block All Dialogs From", !mBlockDialogSpam);
childSetEnabled("Alerts", !mBlockDialogSpam);
childSetEnabled("Friendship Offers", !mBlockDialogSpam);
childSetEnabled("Group Invites", !mBlockDialogSpam);
childSetEnabled("Group Notices", !mBlockDialogSpam);
childSetEnabled("Item Offers", !mBlockDialogSpam);
childSetEnabled("Scripts", !mBlockDialogSpam);
childSetEnabled("Teleport Offers", !mBlockDialogSpam);
//Text Options ------------------------------------------------------------------------
combo = getChild<LLComboBox>("SpellBase");
@@ -518,6 +552,14 @@ void LLPrefsAscentChat::cancel()
gSavedSettings.setU32("_NACL_AntiSpamAmount", mChatSpamCount);
gSavedSettings.setU32("_NACL_AntiSpamTime", mChatSpamTime);
gSavedSettings.setBOOL("_NACL_Antispam", mBlockDialogSpam);
gSavedSettings.setBOOL("AntiSpamAlerts", mBlockAlertSpam);
gSavedSettings.setBOOL("AntiSpamFriendshipOffers", mBlockFriendSpam);
gSavedSettings.setBOOL("AntiSpamGroupNotices", mBlockGroupNoticeSpam);
gSavedSettings.setBOOL("AntiSpamGroupInvites", mBlockGroupInviteSpam);
gSavedSettings.setBOOL("AntiSpamItemOffers", mBlockItemOfferSpam);
gSavedSettings.setBOOL("AntiSpamScripts", mBlockScriptSpam);
gSavedSettings.setBOOL("AntiSpamTeleports", mBlockTeleportSpam);
gSavedSettings.setBOOL("AntiSpamNotify", mNotifyOnSpam);
gSavedSettings.setU32("_NACL_AntiSpamSoundMulti", mSoundMulti);
gSavedSettings.setU32("_NACL_AntiSpamNewlines", mNewLines);
gSavedSettings.setU32("_NACL_AntiSpamSoundPreloadMulti", mPreloadMulti);