public boolean connect() {
try {
//XMPPConnection.DEBUG_ENABLED = true;
connection = new XMPPConnection(host,port,StringUtils.parseServer(jid));
presences = new HashMap<String,PresenceWrapper>();
connection.addPacketListener(new PacketListener() {
public void processPacket(Packet packet) {
System.out.println("Received packet: " + packet.toXML());
if(!(packet instanceof Presence)) return;
//System.out.println(" -- IS Presence packet");
Presence presence = (Presence)packet;