Search in sources :

Example 1 with PhoneEventPacketExtensionProvider

use of org.jivesoftware.phone.client.event.PhoneEventPacketExtensionProvider in project Spark by igniterealtime.

the class PhonePlugin method initialize.

public void initialize() {
    ProviderManager.addExtensionProvider("phone-event", "http://jivesoftware.com/xmlns/phone", new PhoneEventPacketExtensionProvider());
    ProviderManager.addIQProvider("phone-action", "http://jivesoftware.com/xmlns/phone", new PhoneActionIQProvider());
    final XMPPConnection con = SparkManager.getConnection();
    SwingWorker worker = new SwingWorker() {

        public Object construct() {
            try {
                phoneClient = new PhoneClient(con);
                // Add BaseListener
                phoneClient.addEventListener(new PhoneListener());
            } catch (Exception e) {
            // Ignore because the user does not have support.
            // Log.debug(e);
            }
            return phoneClient;
        }

        public void finished() {
            if (phoneClient != null) {
                setupPhoneSystem();
            }
        }
    };
    worker.start();
}
Also used : PhoneEventPacketExtensionProvider(org.jivesoftware.phone.client.event.PhoneEventPacketExtensionProvider) SwingWorker(org.jivesoftware.spark.util.SwingWorker) XMPPConnection(org.jivesoftware.smack.XMPPConnection) PhoneActionIQProvider(org.jivesoftware.phone.client.action.PhoneActionIQProvider)

Aggregations

PhoneActionIQProvider (org.jivesoftware.phone.client.action.PhoneActionIQProvider)1 PhoneEventPacketExtensionProvider (org.jivesoftware.phone.client.event.PhoneEventPacketExtensionProvider)1 XMPPConnection (org.jivesoftware.smack.XMPPConnection)1 SwingWorker (org.jivesoftware.spark.util.SwingWorker)1