#import "AqAdultFilter.h"
#import "NSStringExtensions.h"


@implementation AqAdultFilter

    + (id) instance; {
        static id instance = nil;
        if (!instance) instance = [[AqAdultFilter alloc] init];
        return instance;
    }
    
    - (void) setShouldCensor: (BOOL) theValue; {
        shouldCensor = theValue;
    }

    - (BOOL) shouldCensorName: (id) theName; 
    {
        if (!shouldCensor) return NO;

        if ([theName containsSubstringCaseInsensitive: @"sex"]) 	return YES;
        if ([theName containsSubstringCaseInsensitive: @"fuck"]) 	return YES;
        if ([theName containsSubstringCaseInsensitive: @"porn"]) 	return YES;
        if ([theName containsSubstringCaseInsensitive: @"xxx"]) 	return YES;
        if ([theName containsSubstringCaseInsensitive: @"rape"]) 	return YES;
        if ([theName containsSubstringCaseInsensitive: @"anal"]) 	return YES;
        if ([theName containsSubstringCaseInsensitive: @"cock"]) 	return YES;
        if ([theName containsSubstringCaseInsensitive: @"facial"]) 	return YES;
        if ([theName containsSubstringCaseInsensitive: @"blowjob"]) 	return YES;
        if ([theName containsSubstringCaseInsensitive: @"anal"]) 	return YES;
        
        return NO;
    }

@end
