if (to != null) {
Presence presence = new Presence(Presence.Type.subscribe);
presence.setFrom(connection.getUser());
String toEntity = to + "@vysper.org";
presence.setTo(toEntity);
connection.sendPacket(presence);
chat = connection.getChatManager().createChat(toEntity, new MessageListener() {
public void processMessage(Chat inchat, Message message) {
System.out.println("log received message: " + message.getBody());
}