@Override
    protected void onMode(String channel, String sourceNick, String sourceLogin,
                          String sourceHostname, String mode) {

        // User mode:  +o nickname
        // Channel mode: +m
        String change = mode.substring(0, 1);
        boolean granted = change.equals("+");

        mode = mode.trim().substring(1);
        if ( mode.indexOf(" ") > -1 ) {
            String[] parts = mode.split(" ");
            String type = parts[0];
            String nickname = parts[1];

            ChannelEventsListener listener = getChannelEventsListener(channel);
            if (listener != null) {
                if (granted)
                    listener.userModeGranted(sourceNick, nickname, type);
                else
                    listener.userModeRevoked(sourceNick, nickname, type);
            }
        }
    }