throw new IMException(
"The format of the userID is incorrect. The userID must be of the form userName@jabberServer");
}
String username = userID.substring(0, index);
String serverName = userID.substring(index + 1);
connection = new XMPPConnection(serverName);
try {
connection.connect();
connection.login(username, password);
} catch (XMPPException e) {
loginProcessed = true;