mirror of https://github.com/sipwise/jitsi.git
Committing patches from Lubomir Marinov (moving isRegistered() to AbstractProtocolProviderService) and Keio Kraaner (implementation of message filtering).
parent
c6be00c866
commit
9b93a50c3e
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package net.java.sip.communicator.service.protocol;
|
||||
|
||||
/**
|
||||
* An operation set that allows plugins to register filters which could
|
||||
* intercept instant messages and determine whether or not they should be
|
||||
* dispatched to regular listeners. <tt>EventFilter</tt>-s allow implementating
|
||||
* features that use standard instant messaging channels to exchange
|
||||
*
|
||||
* @author Keio Kraaner
|
||||
*/
|
||||
|
||||
import net.java.sip.communicator.service.protocol.event.*;
|
||||
|
||||
public interface OperationSetInstantMessageFiltering
|
||||
extends OperationSet
|
||||
{
|
||||
/**
|
||||
* Registeres an <tt>EventFilter</tt> with this operation set so that
|
||||
* events, that do not need processing, are filtered out.
|
||||
*
|
||||
* @param filter the <tt>EventFilter</tt> to register.
|
||||
*/
|
||||
public void addEventFilter(EventFilter filter);
|
||||
|
||||
/**
|
||||
* Unregisteres an <tt>EventFilter</tt> so that it won't check any more
|
||||
* if an event should be filtered out.
|
||||
*
|
||||
* @param filter the <tt>EventFilter</tt> to unregister.
|
||||
*/
|
||||
public void removeEventFilter(EventFilter filter);
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.service.protocol.event;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* An event filter that decides whether an instant message event should be
|
||||
* filtered or not. For instance, maybe some type of received messages should not be
|
||||
* shown in the chat windows. In such cases implementations of this filter would block
|
||||
* this message before it is delivered to other IM listeners.
|
||||
* <p>
|
||||
* Note that in order to be able to use this Filter, protocols should implement
|
||||
* <tt>OperationSetMessageFiltering</tt>.
|
||||
* <p>
|
||||
* @author Keio Kraaner
|
||||
*/
|
||||
public interface EventFilter
|
||||
{
|
||||
/**
|
||||
* Checks if an event should be filtered out or processed.
|
||||
*
|
||||
* @param msg The event that should be checked
|
||||
* @return <tt>true</tt> if the event was filtered out, otherwise
|
||||
* <tt>false</tt>.
|
||||
*/
|
||||
public boolean filterEvent(EventObject msg);
|
||||
}
|
||||
Loading…
Reference in new issue