[sip-comm-cvs] CVS update: /sip-communicator/src/net/java/sip/communicator/impl/protocol/icq/, /sip-communicator/src/net/java/sip/communicator/impl/protocol/msn/,...

damencho at dev.java.net damencho at dev.java.net
Wed Apr 11 14:47:43 CEST 2007


User: damencho
Date: 2007-04-11 12:47:43+0000
Modified:
   sip-communicator/src/net/java/sip/communicator/impl/protocol/icq/OperationSetPersistentPresenceIcqImpl.java
   sip-communicator/src/net/java/sip/communicator/impl/protocol/icq/ProtocolProviderServiceIcqImpl.java
   sip-communicator/src/net/java/sip/communicator/impl/protocol/msn/ProtocolProviderServiceMsnImpl.java
   sip-communicator/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java

Log:
 Fix issue - 288 UserCredentials null doesn?t stop account connecting process.

File Changes:

Directory: /sip-communicator/src/net/java/sip/communicator/impl/protocol/icq/
=============================================================================

File [changed]: OperationSetPersistentPresenceIcqImpl.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/src/net/java/sip/communicator/impl/protocol/icq/OperationSetPersistentPresenceIcqImpl.java?r1=1.32&r2=1.33
Delta lines:  +5 -9
-------------------
--- OperationSetPersistentPresenceIcqImpl.java	2007-04-11 11:22:27+0000	1.32
+++ OperationSetPersistentPresenceIcqImpl.java	2007-04-11 12:47:40+0000	1.33
@@ -306,10 +306,6 @@
             }
         }
         
-        // icq status is not set so it must be Offline
-        if(responseRetriever.status == -1)
-            return IcqStatusEnum.OFFLINE;
-
         return icqStatusLongToPresenceStatus(responseRetriever.status);
     }
 
@@ -327,7 +323,11 @@
         // Fixed order of status checking
         // The order does matter, as the icqStatus consists of more than one
         // status for example DND = OCCUPIED | DND | AWAY
-        if ( (icqStatus & FullUserInfo.ICQSTATUS_INVISIBLE ) != 0)
+        if(icqStatus == -1)
+        {
+            return IcqStatusEnum.OFFLINE;
+        }
+        else if ( (icqStatus & FullUserInfo.ICQSTATUS_INVISIBLE ) != 0)
         {
             return IcqStatusEnum.INVISIBLE;
         }
@@ -870,10 +870,6 @@
      */
     public PresenceStatus getPresenceStatus()
     {
-        // if status is not set its offline
-        if(currentIcqStatus == -1)
-            return IcqStatusEnum.OFFLINE;
-        
         return icqStatusLongToPresenceStatus(currentIcqStatus);
     }
 

File [changed]: ProtocolProviderServiceIcqImpl.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/src/net/java/sip/communicator/impl/protocol/icq/ProtocolProviderServiceIcqImpl.java?r1=1.32&r2=1.33
Delta lines:  +11 -0
--------------------
--- ProtocolProviderServiceIcqImpl.java	2007-04-10 15:29:01+0000	1.32
+++ ProtocolProviderServiceIcqImpl.java	2007-04-11 12:47:40+0000	1.33
@@ -222,6 +222,17 @@
                 //request a password from the user
                 credentials = authority.obtainCredentials(getProtocolName()
                                                           , credentials);
+                
+                // in case user has canceled the login window
+                if(credentials == null)
+                {
+                    fireRegistrationStateChanged(
+                        getRegistrationState(),
+                        RegistrationState.UNREGISTERED,
+                        RegistrationStateChangeEvent.REASON_USER_REQUEST, "");
+                    return;
+                }
+                
                 //extract the password the user passed us.
                 char[] pass = credentials.getPassword();
 

Directory: /sip-communicator/src/net/java/sip/communicator/impl/protocol/msn/
=============================================================================

File [changed]: ProtocolProviderServiceMsnImpl.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/src/net/java/sip/communicator/impl/protocol/msn/ProtocolProviderServiceMsnImpl.java?r1=1.12&r2=1.13
Delta lines:  +10 -0
--------------------
--- ProtocolProviderServiceMsnImpl.java	2007-03-21 13:39:30+0000	1.12
+++ ProtocolProviderServiceMsnImpl.java	2007-04-11 12:47:40+0000	1.13
@@ -137,6 +137,16 @@
                 credentials = authority.obtainCredentials(ProtocolNames.MSN
                     , credentials);
 
+                // in case user has canceled the login window
+                if(credentials == null)
+                {
+                    fireRegistrationStateChanged(
+                        getRegistrationState(),
+                        RegistrationState.UNREGISTERED,
+                        RegistrationStateChangeEvent.REASON_USER_REQUEST, "");
+                    return;
+                }
+                
                 //extract the password the user passed us.
                 char[] pass = credentials.getPassword();
 

Directory: /sip-communicator/src/net/java/sip/communicator/impl/protocol/jabber/
================================================================================

File [changed]: ProtocolProviderServiceJabberImpl.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java?r1=1.28&r2=1.29
Delta lines:  +10 -0
--------------------
--- ProtocolProviderServiceJabberImpl.java	2007-04-04 12:53:06+0000	1.28
+++ ProtocolProviderServiceJabberImpl.java	2007-04-11 12:47:41+0000	1.29
@@ -212,6 +212,16 @@
                 credentials = authority.obtainCredentials(ProtocolNames.JABBER
                     , credentials);
 
+                // in case user has canceled the login window
+                if(credentials == null)
+                {
+                    fireRegistrationStateChanged(
+                        getRegistrationState(),
+                        RegistrationState.UNREGISTERED,
+                        RegistrationStateChangeEvent.REASON_USER_REQUEST, "");
+                    return;
+                }
+                
                 //extract the password the user passed us.
                 char[] pass = credentials.getPassword();
 




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





More information about the commits mailing list