Browse Source

Don't send empty join lines. Fixes Issue 3462.

Change-Id: I9bc05a23fb23c12951dd76b5d4abf517f8042972
Reviewed-on: http://gerrit.dmdirc.com/405
Reviewed-by: Chris Smith <chris@dmdirc.com>
Tested-by: Chris Smith <chris@dmdirc.com>
tags/0.6.3
Shane Mc Cormack 14 years ago
parent
commit
8a059f2824
1 changed files with 9 additions and 5 deletions
  1. 9
    5
      src/com/dmdirc/parser/irc/IRCParser.java

+ 9
- 5
src/com/dmdirc/parser/irc/IRCParser.java View File

@@ -1520,11 +1520,15 @@ public class IRCParser implements SecureParser, Runnable {
1520 1520
             }
1521 1521
         }
1522 1522
 
1523
-        for (String thisKey : joinMap.keySet()) {
1524
-            if (thisKey.isEmpty()) {
1525
-                sendString("JOIN " + joinMap.get(thisKey).toString());
1526
-            } else {
1527
-                sendString("JOIN " + joinMap.get(thisKey).toString() + " " + thisKey);
1523
+        for (Map.Entry<String, StringBuffer>  entrySet : joinMap.entrySet()) {
1524
+            final String thisKey = entrySet.getKey();
1525
+            final String channelString = entrySet.getValue().toString();
1526
+            if (!channelString.isEmpty()) {
1527
+                if (thisKey.isEmpty()) {
1528
+                    sendString("JOIN " + channelString);
1529
+                } else {
1530
+                    sendString("JOIN " + channelString + " " + thisKey);
1531
+                }
1528 1532
             }
1529 1533
         }
1530 1534
     }

Loading…
Cancel
Save