ymsg.support
Class AntiSpam

Object
  extended byAntiSpam

public class AntiSpam
extends Object

Provides basic anti-spam functionality for chatrooms.

Since:
1.0

Field Summary
static int CAPS
          Message is overwhelmingly upper case letters.
static int FLOOD
          Message is attempt to flood chatroom.
static int REPEAT
          Message is repeat of recent message.
 
Constructor Summary
AntiSpam()
          Construct a new anti-spam instance.
 
Method Summary
 int getViolations(String u, String m)
          Returns an integer of flags denoting which checks failed.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REPEAT

public static final int REPEAT
Message is repeat of recent message.

Since:
1.0
See Also:
Constant Field Values

FLOOD

public static final int FLOOD
Message is attempt to flood chatroom. (Currently unsupported.)

Since:
1.0
See Also:
Constant Field Values

CAPS

public static final int CAPS
Message is overwhelmingly upper case letters.

Since:
1.0
See Also:
Constant Field Values
Constructor Detail

AntiSpam

public AntiSpam()
Construct a new anti-spam instance.

Since:
1.0
Method Detail

getViolations

public int getViolations(String u,
                         String m)
Returns an integer of flags denoting which checks failed. The static constants elsewhere in this class should be masked against this value to determine whether a particular anti-spam test was 'alerted' by the message provided.

Note: this method will extracted the plain text from a Yahoo richly formatted message automatically. There is no need to do this yourself.

Parameters:
u - id of user who sent the message
m - text of message (can be formatted)
Returns:
int of flags
Since:
1.0