Fix up a mistake in antispam logic where only the user, not any other residents might be blocked.

Adds can_block() to NACLantispam.cpp to unify the blocking checks, so mistakes like this shouldn't happen again.
Best viewed without space changes.
This commit is contained in:
Lirusaito
2013-02-28 14:05:01 -05:00
parent 4990af9cfd
commit 7617f560ab
3 changed files with 35 additions and 39 deletions

View File

@@ -23,6 +23,14 @@
#include <time.h>
#include <boost/lexical_cast.hpp>
bool can_block(const LLUUID& id)
{
if (id.isNull() || gAgent.getID() == id) return false; //Can't block system or self.
if (const LLViewerObject* obj = gObjectList.findObject(id)) //From an object,
return !obj->permYouOwner(); //not own object.
return true;
}
U32 NACLAntiSpamRegistry::globalAmount;
U32 NACLAntiSpamRegistry::globalTime;
bool NACLAntiSpamRegistry::bGlobalQueue;
@@ -308,10 +316,8 @@ void NACLAntiSpamRegistry::blockGlobalEntry(LLUUID& source)
bool NACLAntiSpamRegistry::checkQueue(U32 name, LLUUID& source, U32 multiplier)
//returns true if blocked
{
if(source.isNull() || gAgent.getID() == source) return false;
LLViewerObject *obj=gObjectList.findObject(source);
if(obj && obj->permYouOwner()) return false;
if (!can_block(source)) return false;
int result;
if(bGlobalQueue)
{