org.jivesoftware.spark.ui
Interface MessageFilter


public interface MessageFilter

The MessageFilter interface is one of the interfaces extension writers use to add functionality to Spark.

In general, you implement this interface in order to modify the body of the message.

 String currentBody = message.getBody();
 currentBody = removeAllBadWords(currentBody);
 message.setBody(currentBody);


Method Summary
 void filterIncoming(ChatRoom room, org.jivesoftware.smack.packet.Message message)
          Updates the body of an incoming message.
 void filterOutgoing(ChatRoom room, org.jivesoftware.smack.packet.Message message)
          Update the body of an outgoing message.
 

Method Detail

filterOutgoing

void filterOutgoing(ChatRoom room,
                    org.jivesoftware.smack.packet.Message message)
Update the body of an outgoing message.

Parameters:
message - the message to update.

filterIncoming

void filterIncoming(ChatRoom room,
                    org.jivesoftware.smack.packet.Message message)
Updates the body of an incoming message.

Parameters:
message - the message to update.