public void onDisconnect() {
                GUIMain.add_line(DarkIRC.AppLang.getString("quit_msg"));
                while (!isConnected()) {
                        try {
                                reconnect();
                                Thread.sleep(3000L);
                                for (int i = 0; i < DarkIRC.channelsList.size(); i++) {
                                        if (DarkIRC.channelsList.get(i).name.startsWith("#")) {
                                                this.joinChannel(DarkIRC.channelsList.get(i).name);
                                        }
                                }
                        } catch (Exception e) {
                                try {
                                        Thread.sleep(10000);
                                } catch (Exception e1) {
                                }
                        }
                }
        }