svn commit: r3294 - trunk/src/net/java/sip/communicator/plugin/whiteboard/WhiteboardSessionManager.java

damencho at dev.java.net damencho at dev.java.net
Fri Dec 7 12:37:12 CET 2007


Author: damencho
Date: 2007-12-07 11:37:10+0000
New Revision: 3294

Modified:
   trunk/src/net/java/sip/communicator/plugin/whiteboard/WhiteboardSessionManager.java

Log:
Fix whiteboarding with merged (metcacontacts) which the default contact does not support it. Now the first contact that supports whiteboarding is chosen. 

Modified: trunk/src/net/java/sip/communicator/plugin/whiteboard/WhiteboardSessionManager.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/plugin/whiteboard/WhiteboardSessionManager.java?view=diff&rev=3294&p1=trunk/src/net/java/sip/communicator/plugin/whiteboard/WhiteboardSessionManager.java&p2=trunk/src/net/java/sip/communicator/plugin/whiteboard/WhiteboardSessionManager.java&r1=3293&r2=3294
==============================================================================
--- trunk/src/net/java/sip/communicator/plugin/whiteboard/WhiteboardSessionManager.java	(original)
+++ trunk/src/net/java/sip/communicator/plugin/whiteboard/WhiteboardSessionManager.java	2007-12-07 11:37:10+0000
@@ -71,15 +71,29 @@
     }
 
     /**
-     * Initialize (a new) Whiteboard with contact.
+     * Initialize (a new) Whiteboard with meta contact.
+     * Finds the first protocol contact that supports Whiteboarding
      *
      * @param mc Contact used to init whiteboard
      */
     public void initWhiteboard (MetaContact mc)
     {
-        final Contact contact = mc.getDefaultContact();
+        Contact contact = null;
+        ProtocolProviderService pps = null;
+        Iterator iter = mc.getContacts();
+        while (iter.hasNext())
+        {
+            contact = (Contact)iter.next();
+            pps = contact.getProtocolProvider();
+            
+            opSetWb = (OperationSetWhiteboarding)
+                pps.getOperationSet(OperationSetWhiteboarding.class);
 
-        initWhiteboard(contact);
+            if (opSetWb != null)
+                initWhiteboard(contact);
+        }
+        
+        logger.info("No contact found that supports whiteboarding");
     }
 
     /**
@@ -89,14 +103,6 @@
      */
     public void initWhiteboard (final Contact contact)
     {
-        ProtocolProviderService pps = contact.getProtocolProvider();
-
-        opSetWb = (OperationSetWhiteboarding)
-            pps.getOperationSet(OperationSetWhiteboarding.class);
-
-        if (opSetWb == null)
-            return;
-
         WhiteboardFrame wbf = getWhiteboardFrame (contact);
         if(wbf != null)
         {

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe at sip-communicator.dev.java.net
For additional commands, e-mail: commits-help at sip-communicator.dev.java.net





More information about the commits mailing list