private boolean register(String id) {
		ConnectionConfiguration config = new ConnectionConfiguration(
				XMPP_SERVER, XMPP_PORT);
		Connection connection = new XMPPConnection(config);
		if (registeredLastTime && REGISTRATION_DELAY > 0) {
			System.out.println("Sleeping for " + REGISTRATION_DELAY
					+ " minutes. Need to wait for " + XMPP_SERVER);
			try {
				// macjabber.de allows new account creation only every x
				// minutes
				Thread.sleep(REGISTRATION_DELAY * 60000 + 10);
			} catch (InterruptedException e1) {
				System.err.println("Can't sleep");
			}
		}
		try {
			connection.connect();
		} catch (XMPPException e) {
			e.printStackTrace();
			return false;
		}
		if (!connection.isAuthenticated()) {
			AccountManager acManager = connection.getAccountManager();
			try {
				acManager.createAccount(id, XMPP_PASSWORD);
			} catch (XMPPException e) {
				e.printStackTrace();
				return false;
			} finally {
				registeredLastTime = true;
				connection.disconnect();
			}
		} else {
			connection.disconnect();
		}
		return true;
	}