Browse Source

Fix twitter parser showing error when trying to rejoin &twitter

Fixes CLIENT-149

Change-Id: I02748a320a68dc64a3dc1d982c6afcec187dbde2
Reviewed-on: http://gerrit.dmdirc.com/1748
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
Reviewed-by: Greg Holmes <greg@dmdirc.com>
tags/0.6.5
Chris Smith 13 years ago
parent
commit
b486565a7e
1 changed files with 9 additions and 4 deletions
  1. 9
    4
      src/com/dmdirc/addons/parser_twitter/Twitter.java

+ 9
- 4
src/com/dmdirc/addons/parser_twitter/Twitter.java View File

@@ -270,7 +270,12 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
270 270
         for (final ChannelJoinRequest request : channels) {
271 271
             final String channel = request.getName().trim();
272 272
 
273
-            if (isValidChannelName(channel) && getChannel(channel) == null && !channel.equalsIgnoreCase(mainChannelName)) {
273
+            if (channel.equalsIgnoreCase(mainChannelName)) {
274
+                // The client is always in this channel, so ignore joins for it
275
+                continue;
276
+            }
277
+
278
+            if (isValidChannelName(channel) && getChannel(channel) == null) {
274 279
                 final TwitterChannelInfo newChannel = new TwitterChannelInfo(channel, this);
275 280
                 newChannel.addChannelClient(new TwitterChannelClientInfo(newChannel, myself));
276 281
                 if (channel.matches("^&[0-9]+$")) {
@@ -975,7 +980,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
975 980
 
976 981
     /**
977 982
      * Send a Debug Message using the parser debug api.
978
-     * 
983
+     *
979 984
      * @param code Debug Code for the message.
980 985
      * @param message Content of the message.
981 986
      */
@@ -1522,7 +1527,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
1522 1527
 
1523 1528
     /**
1524 1529
      * This method will send data to the NumericListener and the DataInListener
1525
-     * 
1530
+     *
1526 1531
      * @param numeric Numeric
1527 1532
      * @param token Tokenised Representation.
1528 1533
      */
@@ -1560,7 +1565,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
1560 1565
 
1561 1566
     /**
1562 1567
      * Let the user know twitter failed in some way.
1563
-     * 
1568
+     *
1564 1569
      * @param message Message to send to the user
1565 1570
      */
1566 1571
     private void twitterFail(final String message) {

Loading…
Cancel
Save