Browse Source

Check that pendingjoins actually has a pending join before raising error, and clear if out of sync.

pull/142/head
Shane Mc Cormack 7 years ago
parent
commit
2e7571d3df

+ 7
- 1
irc/src/main/java/com/dmdirc/parser/irc/processors/ProcessJoin.java View File

@@ -193,7 +193,13 @@ public class ProcessJoin extends IRCProcessor {
193 193
         } else {
194 194
             // Some kind of failed to join, pop the pending join queues.
195 195
             final PendingJoin pendingJoin = pendingJoins.poll();
196
-            callDebugInfo(IRCParser.DEBUG_INFO, "processJoin: Failed to join channel (" + sParam + ") - Skipping " + pendingJoin.getChannel() + " (" + pendingJoin.getKey() + ")");
196
+            if (pendingJoin != null && parser.getStringConverter().equalsIgnoreCase(pendingJoin.getChannel(), sParam)) {
197
+                callDebugInfo(IRCParser.DEBUG_INFO, "processJoin: Failed to join channel (" + sParam + ") - Skipping " + pendingJoin.getChannel() + " (" + pendingJoin.getKey() + ")");
198
+            } else {
199
+                // Out of sync, clear
200
+                callDebugInfo(IRCParser.DEBUG_INFO, "processJoin: Failed to join channel (" + sParam + ") - pending join keys out of sync (Got: " + (pendingJoin == null ? pendingJoin : pendingJoin.getChannel()) + ", Wanted: " + sParam + ") - Clearing.");
201
+                pendingJoins.clear();
202
+            }
197 203
         }
198 204
     }
199 205
 

Loading…
Cancel
Save