});
}});
doLogin(type, mode);
} catch (final XMPPException e) {
e.printStackTrace();
final XMPPError error = e.getXMPPError();
if(false && error != null && error.getCode() == 401) {
// MessageBox box = new MessageBox(GOIMPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell(),SWT.ICON_QUESTION | SWT.OK | SWT.CANCEL);
// box.setMessage("Could not log in .. (401 Unauthorized) Trying to register ?");
// int test = box.open();
// if(test != SWT.OK) return;
try {
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
public void run() {
}});
tryRegister();
doLogin(type,mode);
} catch (XMPPException e1) {
e1.printStackTrace();
return;
}
} else {
if(conn != null)
conn.close();
conn = null;
lastPresenceSent = null;
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
public void run() {
ErrorDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),"Error while logging in","Error while trying to log into jabber server: " + account.getServer() + (error == null ? "" : ": " + error.getMessage()),new Status(IStatus.ERROR,GOIMPlugin.ID,IStatus.OK,"Error while logging into account " + account.name,e));
}
});
}
}
}