public interface MessageFilter
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);
Modifier and Type | Method and Description |
---|---|
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.
|
void filterOutgoing(ChatRoom room, org.jivesoftware.smack.packet.Message message)
room
- Room the message is attached to.message
- the message to update.void filterIncoming(ChatRoom room, org.jivesoftware.smack.packet.Message message)
room
- Room the message is attached to.message
- the message to update.