mirror of https://github.com/sipwise/jitsi.git
Adds a protocol aware contact source interface and moves demultiplexing contact source functionality to a separate plug-in. Conference and transfer invite dialogs now show a separate contact for each contact detail (i.e. each telephone number, email address) and search results are taking into account the selected account.
parent
a87481ac4b
commit
a3ef89863f
@ -0,0 +1,58 @@
|
|||||||
|
/*
|
||||||
|
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
|
||||||
|
*
|
||||||
|
* Distributable under LGPL license.
|
||||||
|
* See terms of license at gnu.org.
|
||||||
|
*/
|
||||||
|
package net.java.sip.communicator.plugin.demuxcontactsource;
|
||||||
|
|
||||||
|
import net.java.sip.communicator.service.contactsource.*;
|
||||||
|
|
||||||
|
import org.osgi.framework.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implements <tt>BundleActivator</tt> for the demux contact source plug-in.
|
||||||
|
*
|
||||||
|
* @author Yana Stamcheva
|
||||||
|
*/
|
||||||
|
public class DemuxContactSourceActivator
|
||||||
|
implements BundleActivator
|
||||||
|
{
|
||||||
|
private ServiceRegistration demuxServiceRegistration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Starts the demux contact source plug-in.
|
||||||
|
*
|
||||||
|
* @param bundleContext the <tt>BundleContext</tt> in which the demux
|
||||||
|
* contact source plug-in is to be started
|
||||||
|
* @throws Exception if anything goes wrong while starting the demux
|
||||||
|
* contact source plug-in
|
||||||
|
* @see BundleActivator#start(BundleContext)
|
||||||
|
*/
|
||||||
|
public void start(BundleContext bundleContext) throws Exception
|
||||||
|
{
|
||||||
|
// Registers the service implementation provided by this plugin.
|
||||||
|
demuxServiceRegistration = bundleContext.registerService(
|
||||||
|
DemuxContactSourceService.class.getName(),
|
||||||
|
new DemuxContactSourceServiceImpl(),
|
||||||
|
null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stops the addrbook plug-in.
|
||||||
|
*
|
||||||
|
* @param bundleContext the <tt>BundleContext</tt> in which the addrbook
|
||||||
|
* plug-in is to be stopped
|
||||||
|
* @throws Exception if anything goes wrong while stopping the addrbook
|
||||||
|
* plug-in
|
||||||
|
* @see BundleActivator#stop(BundleContext)
|
||||||
|
*/
|
||||||
|
public void stop(BundleContext bundleContext) throws Exception
|
||||||
|
{
|
||||||
|
if (demuxServiceRegistration != null)
|
||||||
|
{
|
||||||
|
demuxServiceRegistration.unregister();
|
||||||
|
demuxServiceRegistration = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
|
||||||
|
*
|
||||||
|
* Distributable under LGPL license.
|
||||||
|
* See terms of license at gnu.org.
|
||||||
|
*/
|
||||||
|
package net.java.sip.communicator.plugin.demuxcontactsource;
|
||||||
|
|
||||||
|
import net.java.sip.communicator.service.contactsource.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides an implementation of the <tt>DemuxContactSourceService</tt> abstract
|
||||||
|
* class. This implementation provides a de-multiplexed protocol aware copy of
|
||||||
|
* the given <tt>ContactSourceService</tt>.
|
||||||
|
*
|
||||||
|
* @author Yana Stamcheva
|
||||||
|
*/
|
||||||
|
public class DemuxContactSourceServiceImpl
|
||||||
|
extends DemuxContactSourceService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Creates a demultiplexed copy of the given <tt>ContactSourceService</tt>,
|
||||||
|
* where each contact detail like telephone number or protocol contact
|
||||||
|
* address is represented as a single entry in the query result set.
|
||||||
|
*
|
||||||
|
* @param contactSourceService the original <tt>ContactSourceService</tt> to
|
||||||
|
* be demultiplexed
|
||||||
|
* @return a demultiplexed copy of the given <tt>ContactSourceService</tt>
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ContactSourceService createDemuxContactSource(
|
||||||
|
ContactSourceService contactSourceService)
|
||||||
|
{
|
||||||
|
return new DemuxContactSource(contactSourceService);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
Bundle-Activator: net.java.sip.communicator.plugin.demuxcontactsource.DemuxContactSourceActivator
|
||||||
|
Bundle-Description: Demultiplexing contact source
|
||||||
|
Bundle-Name: Demux Contact Source
|
||||||
|
Bundle-Vendor: jitsi.org
|
||||||
|
Bundle-Version: 0.0.1
|
||||||
|
Import-Package: net.java.sip.communicator.service.contactsource,
|
||||||
|
net.java.sip.communicator.service.protocol,
|
||||||
|
org.osgi.framework
|
||||||
|
System-Bundle: yes
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
/*
|
||||||
|
* Jitsi, 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.contactsource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The <tt>DemuxContactSourceService</tt> provides a de-multiplexed copy of
|
||||||
|
* the given <tt>ContactSourceService</tt>, where each contact detail like
|
||||||
|
* telephone number or protocol contact address is represented as a single entry
|
||||||
|
* in the query result set.
|
||||||
|
*
|
||||||
|
* @author Yana Stamcheva
|
||||||
|
*/
|
||||||
|
public abstract class DemuxContactSourceService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Creates a demultiplexed copy of the given <tt>ContactSourceService</tt>,
|
||||||
|
* where each contact detail like telephone number or protocol contact
|
||||||
|
* address is represented as a single entry in the query result set.
|
||||||
|
*
|
||||||
|
* @param contactSourceService the original <tt>ContactSourceService</tt> to
|
||||||
|
* be demultiplexed
|
||||||
|
* @return a demultiplexed copy of the given <tt>ContactSourceService</tt>
|
||||||
|
*/
|
||||||
|
public abstract ContactSourceService createDemuxContactSource(
|
||||||
|
ContactSourceService contactSourceService);
|
||||||
|
}
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* Jitsi, 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.contactsource;
|
||||||
|
|
||||||
|
import net.java.sip.communicator.service.protocol.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The <tt>ProtocolAwareContactSourceService</tt> extends the basic
|
||||||
|
* <tt>ContactSourceService</tt> interface to provide a protocol aware contact
|
||||||
|
* source. In other words a preferred <tt>ProtocolProviderService</tt> can be
|
||||||
|
* set for a given <tt>OperationSet</tt> class that would affect the query
|
||||||
|
* result by excluding source contacts that has a preferred provider different
|
||||||
|
* from the one specified as a preferred provider.
|
||||||
|
*
|
||||||
|
* @author Yana Stamcheva
|
||||||
|
*/
|
||||||
|
public interface ProtocolAwareContactSourceService
|
||||||
|
extends ContactSourceService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Sets the preferred protocol provider for this contact source. The
|
||||||
|
* preferred <tt>ProtocolProviderService</tt> set for a given
|
||||||
|
* <tt>OperationSet</tt> class would affect the query result by excluding
|
||||||
|
* source contacts that has a preferred provider different from the one
|
||||||
|
* specified here.
|
||||||
|
*
|
||||||
|
* @param opSetClass the <tt>OperationSet</tt> class, for which the
|
||||||
|
* preferred provider is set
|
||||||
|
* @param protocolProvider the <tt>ProtocolProviderService</tt> to set
|
||||||
|
*/
|
||||||
|
public void setPreferredProtocolProvider(
|
||||||
|
Class<? extends OperationSet> opSetClass,
|
||||||
|
ProtocolProviderService protocolProvider);
|
||||||
|
}
|
||||||
Loading…
Reference in new issue