All pastes #443506 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-04-16 20:59 UTC
rendered paste body
	HashMap whoisRef = new HashMap();

	public void getUserHost(final String userName, String level) {
		whoisRef.put(userName.toLowerCase(), level);
		sendRawLine("WHOIS "+ userName);
	}
	
	public void onServerResponse(int code, String response) {
		if(code == RPL_WHOISUSER) {
			String parts[] = response.split(" ");
			String userName = parts[1].toLowerCase();
			if(whoisRef.containsKey(userName)) {  // nick
                                doMyDBStuff(userName, parts[3], whoisRef.get(userName));
				whoisRef.remove(userName);
			}
		}
	}