Commits

David Lazar committed d74cc1b

Check that our nick was kicked before trying to rejoin the channel.

Comments (0)

Files changed (1)

src/org/jibble/reminderbot/ReminderBot.java

 
     public synchronized void onKick(String channel, String kickerNick, String kickerLogin,
       String kickerHostname, String recipientNick, String reason) {
-        int kickDelay = 5; // seconds
-        this.log("*** Kicked from channel: " + channel);
+        if (recipientNick.equalsIgnoreCase(getNick())) {
+            int kickDelay = 5; // seconds
+            this.log("*** Kicked from channel: " + channel);
 
-        try {
-            Thread.sleep(kickDelay * 1000);
-        } catch (Exception ignored) {
+            try {
+                Thread.sleep(kickDelay * 1000);
+            } catch (InterruptedException ie) {
+                // ignored
+            }
+
+            joinChannel(channel);
         }
-
-        joinChannel(channel);
     }
 
     private Thread dispatchThread;