@Override
    public void handleEvent(String sender, String type, String receiver, String content) {
        if (type.equals("311")) {
            // Start WHOIS
            waitingWhois = true;
            whoisBuffer = new ArrayList<String>();
        } else if (type.equals("318")) {
            // End WHOIS
            if (waitingWhois) {
                waitingWhois = false;
                whoisBuffer.add(content);
                int n = whoisBuffer.size();
                resultBuffer = new String[n];
                for (int i = 0; i < n; ++i)
                    resultBuffer[i] = whoisBuffer.get(i);
            }
            // Code here for handling the end of the whois command
        } else {
            if (waitingWhois)
                whoisBuffer.add(content);
        }
    }