Remove old spam stuffs, Clean up new spam stuffs to compile, UI new spam stuffs.

This commit is contained in:
Lirusaito
2012-07-19 23:40:07 -04:00
parent 6673c89791
commit f3f8bee83b
10 changed files with 138 additions and 253 deletions

View File

@@ -387,4 +387,20 @@ void NACLAntiSpamRegistry::purgeGlobalEntries()
it2->second = 0;
}
globalEntries.clear();
}
}
bool NACLAntiSpamRegistry::handleNaclAntiSpamGlobalQueueChanged(const LLSD& newvalue)
{
setGlobalQueue(newvalue.asBoolean());
return true;
}
bool NACLAntiSpamRegistry::handleNaclAntiSpamTimeChanged(const LLSD& newvalue)
{
setAllQueueTimes(newvalue.asInteger());
return true;
}
bool NACLAntiSpamRegistry::handleNaclAntiSpamAmountChanged(const LLSD& newvalue)
{
setAllQueueAmounts(newvalue.asInteger());
return true;
}

View File

@@ -49,6 +49,9 @@ public:
static void setAllQueueTimes(U32 amount);
static void setAllQueueAmounts(U32 time);
static bool checkQueue(U32 name, LLUUID& source, U32 multiplier=1, bool silent=false);
static bool handleNaclAntiSpamGlobalQueueChanged(const LLSD& newvalue);
static bool handleNaclAntiSpamTimeChanged(const LLSD& newvalue);
static bool handleNaclAntiSpamAmountChanged(const LLSD& newvalue);
static void clearRegisteredQueue(U32 name);
static void purgeRegisteredQueue(U32 name);
static void clearAllQueues();

View File

@@ -893,6 +893,17 @@
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>_NACL_Antispam</key>
<map>
<key>Comment</key>
<string>When true, all dialogs will be blocked, resets on restart.</string>
<key>Persist</key>
<integer>0</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>_NACL_AntiSpamGlobalQueue</key>
<map>

View File

@@ -141,94 +141,6 @@
<real>1.0</real>
</map>
<key>SGBlockGeneralSpam</key>
<map>
<key>Comment</key>
<string>Enable automatic general spam blocking</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>SGBlockCardSpam</key>
<map>
<key>Comment</key>
<string>Enable automatic calling card spam blocking</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>SGBlockChatSpam</key>
<map>
<key>Comment</key>
<string>Enable automatic chat spam blocking</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>SGBlockDialogSpam</key>
<map>
<key>Comment</key>
<string>Enable automatic dialog spam blocking</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>SGSpamTime</key>
<map>
<key>Comment</key>
<string>Time of Evalulating spam. (Default: 1.000)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>1.0</real>
</map>
<key>SGSpamCount</key>
<map>
<key>Comment</key>
<string>Number of items spammed per time period in SGSpamTime. (Default: 4)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>U32</string>
<key>Value</key>
<real>4</real>
</map>
<key>SGChatSpamTime</key>
<map>
<key>Comment</key>
<string>Time of Evalulating spam. (Default: 1.000)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>1.0</real>
</map>
<key>SGChatSpamCount</key>
<map>
<key>Comment</key>
<string>Number of items spammed per time set in SGSpamTime. (Default: 10)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>U32</string>
<key>Value</key>
<real>10.0</real>
</map>
<key>ShyotlUseLegacyTextureBatching</key>
<map>
<key>Comment</key>

View File

@@ -40,6 +40,7 @@
#include "llradiogroup.h"
#include "lluictrlfactory.h"
#include "llviewercontrol.h"
#include "NACLantispam.h"
#include "lgghunspell_wrapper.h"
#include "llstartup.h"
@@ -78,7 +79,8 @@ LLPrefsAscentChat::LLPrefsAscentChat()
addChild(mObjectDropTarget);
}
if (LLStartUp::getStartupState() == STATE_STARTED)
bool started = LLStartUp::getStartupState() == STATE_STARTED;
if (started)
{
LLUUID itemid = (LLUUID)gSavedPerAccountSettings.getString("AscentInstantMessageResponseItemData");
LLViewerInventoryItem* item = gInventory.getItem(itemid);
@@ -91,6 +93,9 @@ LLPrefsAscentChat::LLPrefsAscentChat()
childSetCommitCallback("im_response", onCommitAutoResponse, this);
childSetEnabled("reset_antispam", started);
childSetCommitCallback("reset_antispam", onCommitResetAS, this);
childSetCommitCallback("KeywordsOn", onCommitKeywords, this);
childSetCommitCallback("KeywordsList", onCommitKeywords, this);
childSetCommitCallback("KeywordsSound", onCommitKeywords, this);
@@ -218,7 +223,7 @@ void LLPrefsAscentChat::onCommitTimeDate(LLUICtrl* ctrl, void* userdata)
//static
void LLPrefsAscentChat::onCommitAutoResponse(LLUICtrl* ctrl, void* user_data)
{
LLPrefsAscentChat* self = (LLPrefsAscentChat*)user_data;
LLPrefsAscentChat* self = (LLPrefsAscentChat*)user_data;
gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseAnyone", self->childGetValue("AscentInstantMessageResponseAnyone"));
gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseFriends", self->childGetValue("AscentInstantMessageResponseFriends"));
@@ -237,6 +242,12 @@ void LLPrefsAscentChat::SinguIMResponseItemDrop(LLViewerInventoryItem* item)
sInst->childSetValue("im_give_disp_rect_txt","Currently set to: "+item->getName());
}
//static
void LLPrefsAscentChat::onCommitResetAS(LLUICtrl*, void*)
{
NACLAntiSpamRegistry::purgeAllQueues();
}
//static
void LLPrefsAscentChat::onCommitKeywords(LLUICtrl* ctrl, void* user_data)
{
@@ -316,13 +327,13 @@ void LLPrefsAscentChat::refreshValues()
mIMResponseText = gSavedPerAccountSettings.getString("AscentInstantMessageResponse");
//Spam --------------------------------------------------------------------------------
mBlockChatSpam = gSavedSettings.getBOOL("SGBlockChatSpam");
mChatSpamCount = gSavedSettings.getU32("SGChatSpamCount");
mChatSpamTime = gSavedSettings.getF32("SGChatSpamTime");
mBlockDialogSpam = gSavedSettings.getBOOL("SGBlockDialogSpam");
mBlockCardSpam = gSavedSettings.getBOOL("SGBlockCardSpam");
mSpamCount = gSavedSettings.getU32("SGSpamCount");
mSpamTime = gSavedSettings.getF32("SGSpamTime");
mGlobalQueue = gSavedSettings.getBOOL("_NACL_AntiSpamGlobalQueue");
mChatSpamCount = gSavedSettings.getU32("_NACL_AntiSpamAmount");
mChatSpamTime = gSavedSettings.getU32("_NACL_AntiSpamTime");
mBlockDialogSpam = gSavedSettings.getBOOL("_NACL_Antispam");
mSoundMulti = gSavedSettings.getU32("_NACL_AntiSpamSoundMulti");
mNewLines = gSavedSettings.getU32("_NACL_AntiSpamNewlines");
mPreloadMulti = gSavedSettings.getU32("_NACL_AntiSpamSoundPreloadMulti");
//Text Options ------------------------------------------------------------------------
mSpellDisplay = gSavedSettings.getBOOL("SpellDisplay");
@@ -503,13 +514,13 @@ void LLPrefsAscentChat::cancel()
gSavedPerAccountSettings.setString("AscentInstantMessageResponse", mIMResponseText);
//Spam --------------------------------------------------------------------------------
gSavedSettings.setBOOL("SGBlockChatSpam", mBlockChatSpam);
gSavedSettings.setU32("SGChatSpamCount", mChatSpamCount);
gSavedSettings.setF32("SGChatSpamTime", mChatSpamTime);
gSavedSettings.setBOOL("SGBlockDialogSpam", mBlockDialogSpam);
gSavedSettings.setBOOL("SGBlockCardSpam", mBlockCardSpam);
gSavedSettings.setU32("SGSpamCount", mSpamCount);
gSavedSettings.setF32("SGSpamTime", mSpamTime);
gSavedSettings.setBOOL("_NACL_AntiSpamGlobalQueue", mGlobalQueue);
gSavedSettings.setU32("_NACL_AntiSpamAmount", mChatSpamCount);
gSavedSettings.setU32("_NACL_AntiSpamTime", mChatSpamTime);
gSavedSettings.setBOOL("_NACL_Antispam", mBlockDialogSpam);
gSavedSettings.setU32("_NACL_AntiSpamSoundMulti", mSoundMulti);
gSavedSettings.setU32("_NACL_AntiSpamNewlines", mNewLines);
gSavedSettings.setU32("_NACL_AntiSpamSoundPreloadMulti", mPreloadMulti);
//Text Options ------------------------------------------------------------------------
gSavedSettings.setBOOL("SpellDisplay", mSpellDisplay);

View File

@@ -56,6 +56,7 @@ protected:
static void onSpellBaseComboBoxCommit(LLUICtrl* ctrl, void* userdata);
static void onCommitTimeDate(LLUICtrl* ctrl, void *userdata);
static void onCommitAutoResponse(LLUICtrl* ctrl, void* user_data);
static void onCommitResetAS(LLUICtrl*,void*);
static void onCommitKeywords(LLUICtrl* ctrl, void* user_data);
//Chat/IM -----------------------------------------------------------------------------
@@ -84,13 +85,13 @@ protected:
std::string mIMResponseText;
//Spam --------------------------------------------------------------------------------
BOOL mBlockChatSpam;
BOOL mGlobalQueue;
U32 mChatSpamCount;
F32 mChatSpamTime;
U32 mChatSpamTime;
BOOL mBlockDialogSpam;
BOOL mBlockCardSpam;
U32 mSpamCount;
F32 mSpamTime;
BOOL mSoundMulti;
U32 mNewLines;
U32 mPreloadMulti;
//Text Options ------------------------------------------------------------------------
BOOL mSpellDisplay;

View File

@@ -1063,6 +1063,9 @@ bool idle_startup()
U32 antispam_time = gSavedSettings.getU32("_NACL_AntiSpamTime");
U32 antispam_amount = gSavedSettings.getU32("_NACL_AntiSpamAmount");
NACLAntiSpamRegistry::registerQueues(antispam_time, antispam_amount);
gSavedSettings.getControl("_NACL_AntiSpamGlobalQueue")->getSignal()->connect(boost::bind(&NACLAntiSpamRegistry::handleNaclAntiSpamGlobalQueueChanged, _2));
gSavedSettings.getControl("_NACL_AntiSpamTime")->getSignal()->connect(boost::bind(&NACLAntiSpamRegistry::handleNaclAntiSpamTimeChanged, _2));
gSavedSettings.getControl("_NACL_AntiSpamAmount")->getSignal()->connect(boost::bind(&NACLAntiSpamRegistry::handleNaclAntiSpamAmountChanged, _2));
// NaCl End
//good as place as any to create user windlight directories
@@ -4362,3 +4365,4 @@ bool process_login_success_response(std::string& password)
}
return success;
}

View File

@@ -574,25 +574,6 @@ bool handleVoiceClientPrefsChanged(const LLSD& newvalue)
return true;
}
// NaCl - Antispam Registry
bool handleNaclAntiSpamGlobalQueueChanged(const LLSD& newvalue)
{
NACLAntiSpamRegistry::setGlobalQueue(newvalue.asBoolean());
return true;
}
bool handleNaclAntiSpamTimeChanged(const LLSD& newvalue)
{
NACLAntiSpamRegistry::setAllQueueTimes(newvalue.asInteger());
return true;
}
bool handleNaclAntiSpamAmountChanged(const LLSD& newvalue)
{
NACLAntiSpamRegistry::setAllQueueAmounts(newvalue.asInteger());
return true;
}
// NaCl End
bool handleTranslateChatPrefsChanged(const LLSD& newvalue)
{
LLFloaterChat* floaterp = LLFloaterChat::getInstance();
@@ -815,12 +796,6 @@ void settings_setup_listeners()
// [/Ansariel: Display name support]
gSavedSettings.getControl("AllowLargeSounds")->getSignal()->connect(boost::bind(&handleAllowLargeSounds, _2));
// NaCl - Antispam Registry
gSavedSettings.getControl("_NACL_AntiSpamGlobalQueue")->getSignal()->connect(boost::bind(&handleNaclAntiSpamGlobalQueueChanged, _2));
gSavedSettings.getControl("_NACL_AntiSpamTime")->getSignal()->connect(boost::bind(&handleNaclAntiSpamTimeChanged, _2));
gSavedSettings.getControl("_NACL_AntiSpamAmount")->getSignal()->connect(boost::bind(&handleNaclAntiSpamAmountChanged, _2));
// NaCl End
}
void onCommitControlSetting_gSavedSettings(LLUICtrl* ctrl, void* name)

View File

@@ -246,75 +246,6 @@ const BOOL SCRIPT_QUESTION_IS_CAUTION[SCRIPT_PERMISSION_EOF] =
FALSE // ControlYourCamera
};
template <typename T>
class SH_SpamHandler
{
public:
SH_SpamHandler(const char *pToggleCtrl, const char *pDurCtrl, const char *pFreqCtrl) :
mDuration(pDurCtrl, 1.f),
mFrequency(pFreqCtrl, 5),
mEnabled(false)
{
gSavedSettings.getControl(pToggleCtrl)->getSignal()->connect(boost::bind(&SH_SpamHandler::CtrlToggle, this, _2));
CtrlToggle(gSavedSettings.getBOOL(pToggleCtrl));
}
bool CtrlToggle(const LLSD& newvalue)
{
bool on = newvalue.asBoolean();
if(on == mEnabled)
return true;
mEnabled = on;
mTimer.stop();
mActiveList.clear();
mBlockedList.clear();
return true;
}
bool isBlocked(const T &owner, const LLUUID &source_id, const char *pNotification, LLSD args=LLSD())
{
if(!mEnabled || isAgent(owner))
return false;
if(mBlockedList.find(owner) != mBlockedList.end())
return true;
if(mTimer.getStarted() && mTimer.getElapsedTimeF32() < mDuration)
{
typename std::map<const T,U32>::iterator it = mActiveList.insert(std::pair<const T, U32>(owner,0)).first;
if(++(it->second)>=mFrequency)
{
mBlockedList.insert(owner);
if(pNotification)
{
args["OWNER"] = owner;
args["SOURCE"] = source_id;
LLNotifications::getInstance()->add(pNotification,args);
}
return true;
}
}
else
{
mActiveList.clear();
mTimer.start();
}
return false;
}
private:
//Owner is either a key, or a name. Do not look up perms since object may be unknown.
static bool isAgent(const T &owner);
bool mEnabled;
LLFrameTimer mTimer;
const LLCachedControl<F32> mDuration;
const LLCachedControl<U32> mFrequency;
std::map<const T,U32> mActiveList;
std::set<T> mBlockedList;
};
template<> bool SH_SpamHandler<LLUUID>::isAgent(const LLUUID &owner) { return gAgent.getID() == owner; }
template<> bool SH_SpamHandler<std::string>::isAgent(const std::string &owner)
{
std::string str;
gAgent.getName(str);
return str == owner;
}
bool friendship_offer_callback(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
@@ -1705,11 +1636,6 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
void inventory_offer_handler(LLOfferInfo* info, BOOL from_task)
{
// NaCl - Antispam Registry
if(NACLAntiSpamRegistry::checkQueue((U32)NACLAntiSpamRegistry::QUEUE_INVENTORY,info->mFromID))
return;
// NaCl End
//Until throttling is implmented, busy mode should reject inventory instead of silently
//accepting it. SEE SL-39554
if (gAgent.getBusy())
@@ -1717,7 +1643,12 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task)
info->forceResponse(IOR_BUSY);
return;
}
// NaCl - Antispam Registry
static LLCachedControl<bool> antispam(gSavedSettings,"_NACL_Antispam");
if(antispam || NACLAntiSpamRegistry::checkQueue((U32)NACLAntiSpamRegistry::QUEUE_INVENTORY,info->mFromID))
return;
// NaCl End
//If muted, don't even go through the messaging stuff. Just curtail the offer here.
if (LLMuteList::getInstance()->isMuted(info->mFromID, info->mFromName))
{
@@ -1971,6 +1902,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
{
return;
}
static LLCachedControl<bool> antispam(gSavedSettings,"_NACL_Antispam");
LLUUID from_id;
BOOL from_group;
LLUUID to_id;
@@ -2059,15 +1991,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
{
LLSD args;
args["NAME"] = name;
static SH_SpamHandler<LLUUID> avatar_spam_check("SGBlockGeneralSpam","SGSpamTime","SGSpamCount");
static SH_SpamHandler<LLUUID> object_spam_check("SGBlockGeneralSpam","SGSpamTime","SGSpamCount");
if(d==IM_FROM_TASK||d==IM_GOTO_URL||d==IM_FROM_TASK_AS_ALERT||d==IM_TASK_INVENTORY_OFFERED||d==IM_TASK_INVENTORY_ACCEPTED||d==IM_TASK_INVENTORY_DECLINED)
{
if(object_spam_check.isBlocked(from_id,session_id,"BlockedGeneralObjects",args))
return;
}
else if(avatar_spam_check.isBlocked(from_id,from_id,"BlockedGeneralAvatar",args))
return;
}
LLViewerObject *source = gObjectList.findObject(session_id); //Session ID is probably the wrong thing.
@@ -2501,6 +2424,10 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
case IM_GROUP_NOTICE:
case IM_GROUP_NOTICE_REQUESTED:
{
// NaCl - Antispam
if(antispam)
return;
// NaCl End
LL_INFOS("Messaging") << "Received IM_GROUP_NOTICE message." << LL_ENDL;
// Read the binary bucket for more information.
struct notice_bucket_header_t
@@ -2596,6 +2523,10 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
break;
case IM_GROUP_INVITATION:
{
// NaCl - Antispam
if(antispam)
return;
// NaCl End
//if (!is_linden && (is_busy || is_muted))
if ((is_busy || is_muted))
{
@@ -2640,6 +2571,10 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
case IM_TASK_INVENTORY_OFFERED:
// Someone has offered us some inventory.
{
// NaCl - Antispam
if(antispam)
return;
// NaCl End
LLOfferInfo* info = new LLOfferInfo;
if (IM_INVENTORY_OFFERED == dialog)
@@ -2892,6 +2827,10 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
}
break;
case IM_FROM_TASK_AS_ALERT:
// NaCl - Antispam
if(antispam)
return;
// NaCl End
if (is_busy && !is_owned_by_me)
{
return;
@@ -2929,6 +2868,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
case IM_LURE_USER:
{
if(antispam) return; //NaCl Antispam
// [RLVa:KB] - Checked: 2010-12-11 (RLVa-1.2.2c) | Added: RLVa-1.2.2c
// If the lure sender is a specific @accepttp exception they will override muted and busy status
bool fRlvSummon = (rlv_handler_t::isEnabled()) && (gRlvHandler.isException(RLV_BHVR_ACCEPTTP, from_id));
@@ -3069,6 +3009,10 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
case IM_GOTO_URL:
{
// NaCl - Antispam
if(antispam)
return;
// NaCl End
LLSD args;
// n.b. this is for URLs sent by the system, not for
// URLs sent by scripts (i.e. llLoadURL)
@@ -3093,6 +3037,10 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
case IM_FRIENDSHIP_OFFERED:
{
// NaCl - Antispam
if(antispam)
return;
// NaCl End
LLSD payload;
payload["from_id"] = from_id;
payload["session_id"] = session_id;;
@@ -3227,6 +3175,11 @@ static LLNotificationFunctorRegistration callingcard_offer_cb_reg("OfferCallingC
void process_offer_callingcard(LLMessageSystem* msg, void**)
{
// NaCl - Antispam
static LLCachedControl<bool> antispam(gSavedSettings,"_NACL_Antispam");
if(antispam)
return;
// NaCl End
// someone has offered to form a friendship
LL_DEBUGS("Messaging") << "callingcard offer" << LL_ENDL;
@@ -3270,9 +3223,6 @@ void process_offer_callingcard(LLMessageSystem* msg, void**)
}
else
{
static SH_SpamHandler<LLUUID> spam_check("SGBlockCardSpam","SHSpamTime","SGSpamCount");
if(spam_check.isBlocked(source_id,source_id,"BlockedCards",args))
return;
LLNotificationsUtil::add("OfferCallingCard", args, payload);
}
}
@@ -3482,12 +3432,6 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
{
LLSD args;
args["NAME"] = from_name;
static SH_SpamHandler<LLUUID> avatar_spam_check("SGBlockChatSpam","SGChatSpamTime","SGChatSpamCount");
static SH_SpamHandler<LLUUID> object_spam_check("SGBlockChatSpam","SGChatSpamTime","SGChatSpamCount");
if( (chatter->isAvatar() && avatar_spam_check.isBlocked(from_id,from_id,"BlockedChatterAvatar",args)) ||
(!chatter->isAvatar() && object_spam_check.isBlocked(owner_id,from_id,"BlockedChatterObjects",args)) )
return;
chat.mPosAgent = chatter->getPositionAgent();
// Make swirly things only for talking objects. (not script debug messages, though)
@@ -6132,12 +6076,10 @@ void process_economy_data(LLMessageSystem *msg, void** /*user_data*/)
void notify_cautioned_script_question(const LLSD& notification, const LLSD& response, S32 orig_questions, BOOL granted)
{
// NaCl - Antispam Registry
if(NACLAntiSpamRegistry::checkQueue((U32)NACLAntiSpamRegistry::QUEUE_SCRIPT_DIALOG, notification["payload"]["task_id"].asUUID()))
return;
// NaCl End
// NaCl - Antispam Registry
LLUUID task_id = notification["payload"]["task_id"].asUUID();
if(NACLAntiSpamRegistry::checkQueue((U32)NACLAntiSpamRegistry::QUEUE_SCRIPT_DIALOG,task_id)) return;
// NaCl End
// only continue if at least some permissions were requested
if (orig_questions)
{
@@ -6304,7 +6246,12 @@ static LLNotificationFunctorRegistration script_question_cb_reg_2("ScriptQuestio
void process_script_question(LLMessageSystem *msg, void **user_data)
{
// *TODO:translate owner name -> [FIRST] [LAST]
// NaCl - Antispam
static LLCachedControl<bool> antispam(gSavedSettings,"_NACL_Antispam");
if(antispam)
return;
// NaCl End
// *TODO: Translate owner name -> [FIRST] [LAST]
LLHost sender = msg->getSender();
@@ -6984,6 +6931,11 @@ static LLNotificationFunctorRegistration callback_script_dialog_reg_2("ScriptDia
void process_script_dialog(LLMessageSystem* msg, void**)
{
// NaCl - Antispam
static LLCachedControl<bool> antispam(gSavedSettings,"_NACL_Antispam");
if(antispam)
return;
// NaCl End
S32 i;
LLSD payload;
@@ -7078,10 +7030,6 @@ void process_script_dialog(LLMessageSystem* msg, void**)
{
args["NAME"] = LLCacheName::buildFullName(first_name, last_name);
static SH_SpamHandler<std::string> spam_check("SGBlockDialogSpam","SGSpamTime","SGSpamCount");
if(spam_check.isBlocked(first_name + " " + last_name,object_id,"BlockedDialogs",args))
return;
if (is_text_box)
{
args["DEFAULT"] = default_text;
@@ -7165,6 +7113,11 @@ void callback_load_url_name(const LLUUID& id, const std::string& full_name, bool
void process_load_url(LLMessageSystem* msg, void**)
{
// NaCl - Antispam
static LLCachedControl<bool> antispam(gSavedSettings,"_NACL_Antispam");
if(antispam)
return;
// NaCl End
LLUUID object_id;
LLUUID owner_id;
BOOL owner_is_group;
@@ -7255,6 +7208,11 @@ void process_initiate_download(LLMessageSystem* msg, void**)
void process_script_teleport_request(LLMessageSystem* msg, void**)
{
// NaCl - Antispam
static LLCachedControl<bool> antispam(gSavedSettings,"_NACL_Antispam");
if(antispam)
return;
// NaCl End
if (!gSavedSettings.getBOOL("ScriptsCanShowUI")) return;
std::string object_name;

View File

@@ -68,20 +68,14 @@
</panel>
<panel border="true" left="1" bottom="-408" height="408" width="500" label="Spam" name="Spam">
<check_box left="10" bottom_delta="-25" follows="top" font="SansSerifSmall"
label="Enable chat spam blocking" tool_tip="Enable automatic chat spam blocking" name="AscChatSpamBlock" control_name="SGBlockChatSpam"/>
<spinner left_delta="20" height="18" width="120" follows="top" decimal_digits="0" increment="1" initial_val="10" min_val="2" max_val="100"
label="Chat count" label_width="70" tool_tip="Number of items spammed per time set. (Default: 10)" name="AscChatSpamCount" control_name="SGChatSpamCount"/>
<spinner height="18" width="120" follows="left|top" decimal_digits="1" increment="1" initial_val="1.0" min_val="1" max_val="60"
label="Chat time" label_width="70" name="AscChatSpamTime" control_name="SGChatSpamTime" tool_tip="Time of evalulating spam in seconds. (Default: 1.0)"/>
<text bottom_delta="0" left_delta="130" height="16" follows="top" name="" width="100">seconds</text>
<check_box left_delta="-150" height="16" follows="top" label="Enable dialog spam blocking" tool_tip="Enable automatic dialog spam blocking" name="AscDialogSpamBlock" control_name="SGBlockDialogSpam"/>
<check_box height="16" follows="left|top" label="Enable calling card spam blocking" tool_tip="Enable automatic calling card spam blocking" name="AscCardSpamBlock" control_name="SGBlockCardSpam"/>
<spinner left_delta="20" height="18" width="120" follows="top" decimal_digits="0" increment="1" initial_val="4" min_val="2" max_val="100"
label="Spam count" label_width="70" name="AscSpamCount" control_name="SGSpamCount" tool_tip="This setting applies to both Dialog and Card spam (Default: 4)"/>
<spinner height="18" width="120" follows="left|top" decimal_digits="1" increment="1" initial_val="1.0" min_val="1" max_val="60"
label="Spam time" label_width="70" name="AscSpamTime" control_name="SGSpamTime" tool_tip="This setting applies to both Dialog and Card spam (Default: 1.0)"/>
<text bottom_delta="0" left_delta="130" height="16" follows="top" name="">seconds</text>
<check_box control_name="_NACL_AntiSpamGlobalQueue" label="No messagetype-specific spam queues" name="spammsg_checkbox" width="256" left="6"/>
<button height="23" label="Reset antispam queues" label_selected="Reset antispam queues" name="reset_antispam" width="230" bottom_delta="0" left="260"/>
<spinner control_name="_NACL_AntiSpamTime" decimal_digits="0" increment="1" min_val="1" max_val="60" label="Antispam time(seconds):" label_width="330" name="antispamtime" width="390" left="10"/>
<spinner control_name="_NACL_AntiSpamAmount" decimal_digits="0" increment="1" min_val="5" max_val="100" label="Antispam amount:" label_width="330" name="antispamamount" width="390"/>
<spinner control_name="_NACL_AntiSpamSoundMulti" decimal_digits="0" increment="1" min_val="1" max_val="100" label="Amount multiplicatior for sound antispam:" label_width="330" left="10" name="antispamsoundmulti" width="390"/>
<spinner control_name="_NACL_AntiSpamSoundPreloadMulti" decimal_digits="0" increment="1" min_val="1" max_val="99999" label="Amount multiplicatior for sound preload antispam:" label_width="330" name="antispamsoundpreloadmulti" width="390"/>
<spinner control_name="_NACL_AntiSpamNewlines" decimal_digits="0" increment="1" min_val="5" max_val="99999" label="Amount of newlines to instablock message:" label_width="330" name="antispamnewlines" width="390"/>
<check_box control_name="_NACL_Antispam" height="16" label="Disable -all- dialogs (resets on login)" name="antispam_checkbox" left="6"/>
</panel>
<panel border="true" bottom="-580" height="525" label="Text Options" left="1" name="TextOptions" width="418">