### Eclipse Workspace Patch 1.0 #P org.eclipse.ecf.protocol.msn Index: src/org/eclipse/ecf/protocol/msn/NotificationSession.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.ecf/providers/org.eclipse.ecf.protocol.msn/src/org/eclipse/ecf/protocol/msn/NotificationSession.java,v retrieving revision 1.1 diff -u -r1.1 NotificationSession.java --- src/org/eclipse/ecf/protocol/msn/NotificationSession.java 19 Apr 2007 02:05:20 -0000 1.1 +++ src/org/eclipse/ecf/protocol/msn/NotificationSession.java 27 Jul 2007 11:52:49 -0000 @@ -7,6 +7,7 @@ * * Contributors: * Remy Suen - initial API and implementation + * Cagatay Calli - https://bugs.eclipse.org/bugs/show_bug.cgi?id=196812 ******************************************************************************/ package org.eclipse.ecf.protocol.msn; @@ -102,24 +103,30 @@ .getParam(3)); password = null; - write("USR", "TWN S " + ticket); //$NON-NLS-1$ //$NON-NLS-2$ - ticket = null; - String input = super.read(); - if (!input.startsWith("USR")) { //$NON-NLS-1$ - throw new ConnectException( - "An error occurred while attempting to authenticate " - + "with the Tweener server."); + if(ticket == null){ + throw new ConnectException("Wrong username and/or password."); + } + else { + write("USR", "TWN S " + ticket); //$NON-NLS-1$ //$NON-NLS-2$ + ticket = null; + String input = super.read(); + if (!input.startsWith("USR")) { //$NON-NLS-1$ + throw new ConnectException( + "An error occurred while attempting to authenticate " + + "with the Tweener server."); + } + + retrieveBuddyList(); + this.username = username; + return true; } - - retrieveBuddyList(); - this.username = username; - return true; } else if (!response.getCommand().equals("XFR")) { //$NON-NLS-1$ throw new ConnectException("Unable to connect to the MSN server."); } else { alternateServer = response.getParam(2); return false; } + } private void retrieveBuddyList() throws IOException { Index: src/org/eclipse/ecf/protocol/msn/internal/net/ClientTicketRequest.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.ecf/providers/org.eclipse.ecf.protocol.msn/src/org/eclipse/ecf/protocol/msn/internal/net/ClientTicketRequest.java,v retrieving revision 1.1 diff -u -r1.1 ClientTicketRequest.java --- src/org/eclipse/ecf/protocol/msn/internal/net/ClientTicketRequest.java 19 Apr 2007 02:05:20 -0000 1.1 +++ src/org/eclipse/ecf/protocol/msn/internal/net/ClientTicketRequest.java 27 Jul 2007 11:52:49 -0000 @@ -7,6 +7,7 @@ * * Contributors: * Remy Suen - initial API and implementation + * Cagatay Calli - https://bugs.eclipse.org/bugs/show_bug.cgi?id=196812 ******************************************************************************/ package org.eclipse.ecf.protocol.msn.internal.net; @@ -87,7 +88,7 @@ * the user's password * @param challengeString * the challenge string received from the notification session - * @return the client ticket + * @return the client ticket if login info is correct, null otherwise * @throws IOException * If an I/O error occurs while connecting to the Passport Nexus * page or when getting the response codes from the connection @@ -120,6 +121,10 @@ daLoginURL = daLoginURL.substring(1, daLoginURL .length() - 1); } + else if(request.getResponseCode() == HttpURLConnection.HTTP_UNAUTHORIZED){ + request.disconnect(); + return null; + } } } catch (Exception e) { if (request.getResponseCode() == HttpURLConnection.HTTP_UNAUTHORIZED) {