diff options
Diffstat (limited to 'src/net/java/sip/communicator/impl/protocol')
3 files changed, 36 insertions, 12 deletions
diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java index b40c9ce..2b4092b 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java @@ -1189,6 +1189,15 @@ public class ProtocolProviderServiceJabberImpl return connection; } + /** + * Determines whether a specific <tt>XMPPException</tt> signals that + * attempted authentication has failed. + * + * @param ex the <tt>XMPPException</tt> which is to be determined whether it + * signals that attempted authentication has failed + * @return <tt>true</tt> if the specified <tt>ex</tt> signals that attempted + * authentication has failed; otherwise, <tt>false</tt> + */ private boolean isAuthenticationFailed(XMPPException ex) { String exMsg = ex.getMessage().toLowerCase(); @@ -1196,16 +1205,12 @@ public class ProtocolProviderServiceJabberImpl // as there are no types or reasons for XMPPException // we try determine the reason according to their message // all messages that were found in smack 3.1.0 were took in count - if(exMsg.indexOf("authentication failed") != -1 - || (exMsg.indexOf("authentication") != -1 - && exMsg.indexOf("failed") != -1) - || exMsg.indexOf("login failed") != -1 - || exMsg.indexOf("unable to determine password") != -1) - { - return true; - } - else - return false; + return + (exMsg.indexOf("authentication failed") != -1) + || ((exMsg.indexOf("authentication") != -1) + && (exMsg.indexOf("failed") != -1)) + || (exMsg.indexOf("login failed") != -1) + || (exMsg.indexOf("unable to determine password") != -1); } /** diff --git a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetPresenceSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetPresenceSipImpl.java index 143d28e..2f30fe5 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetPresenceSipImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetPresenceSipImpl.java @@ -3176,7 +3176,7 @@ public class OperationSetPresenceSipImpl /** * Implements the corresponding <tt>SipListener</tt> method by - * terminating the corresponding subsctiption and polling the related + * terminating the corresponding subscription and polling the related * contact. * * @param requestEvent the event containing the request that was \ diff --git a/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java index 0478c57..7e0fff4 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java @@ -301,7 +301,26 @@ public class ProtocolProviderServiceSipImpl return this.registeredEvents; } - + /** + * Overrides + * {@link AbstractProtocolProviderService#fireRegistrationStateChanged( + * RegistrationState, RegistrationState, int, String)} in order to add + * enabling/disabling XCAP functionality in accord with the current + * <tt>RegistrationState</tt> of this + * <tt>ProtocolProviderServiceSipImpl</tt>. + * + * @param oldState the state that the provider had before the change + * occurred + * @param newState the state that the provider is currently in + * @param reasonCode a value corresponding to one of the REASON_XXX fields + * of the <tt>RegistrationStateChangeEvent</tt> class, indicating the reason + * for this state transition + * @param reason a <tt>String</tt> further explaining the reason code or + * <tt>null</tt> if no such explanation is necessary + * @see AbstractProtocolProviderService#fireRegistrationStateChanged( + * RegistrationState, RegistrationState, int, String) + */ + @Override public void fireRegistrationStateChanged(RegistrationState oldState, RegistrationState newState, int reasonCode, |