Browse Source

Parser now sends queued channel modes as soon as the max number is reached, rather than waiting for the next one

Fixes issue 1107

git-svn-id: http://svn.dmdirc.com/trunk@3905 00569f92-eb28-0410-84fd-f71c24880f
tags/0.6
Chris Smith 16 years ago
parent
commit
edfbc5fdf2

+ 1
- 1
src/com/dmdirc/Main.java View File

@@ -53,7 +53,7 @@ public final class Main {
53 53
     public static final String VERSION = "SVN";
54 54
 
55 55
     /** The SVN revision that this build was made from. */
56
-    public static final int SVN_REVISION = 3853; // 3853; // 3853; // 3853; // 3628; // 3601;
56
+    public static final int SVN_REVISION = 3853;
57 57
 
58 58
     /** Stores the update channel that this version came from, if any. */
59 59
     public static final UpdateChannel UPDATE_CHANNEL = UpdateChannel.NONE;

+ 6
- 5
src/com/dmdirc/parser/ChannelInfo.java View File

@@ -605,7 +605,7 @@ public final class ChannelInfo {
605 605
 			}
606 606
 		}
607 607
 		if (!myParser.isUserSettable(mode)) { return; }
608
-		if (lModeQueue.size() == modecount) { sendModes(); }
608
+
609 609
 		if (positive) { modestr = "+"; } else { modestr = "-"; }
610 610
 		modestr = modestr + mode;
611 611
 		if (!myParser.hChanModesBool.containsKey(mode)) {
@@ -614,17 +614,18 @@ public final class ChannelInfo {
614 614
 				modestr = modestr + " " + parameter;
615 615
 			} else {
616 616
 				modecount = myParser.hChanModesOther.get(mode);
617
-				if ((modecount & myParser.MODE_LIST) == myParser.MODE_LIST) {
617
+				if ((modecount & IRCParser.MODE_LIST) == IRCParser.MODE_LIST) {
618 618
 					modestr = modestr + " " + parameter;
619
-				} else if (!positive && ((modecount & myParser.MODE_UNSET) == myParser.MODE_UNSET)) {
619
+				} else if (!positive && ((modecount & IRCParser.MODE_UNSET) == IRCParser.MODE_UNSET)) {
620 620
 					modestr = modestr + " " + parameter;
621
-				} else if (positive && ((modecount & myParser.MODE_SET) == myParser.MODE_SET)) {
621
+				} else if (positive && ((modecount & IRCParser.MODE_SET) == IRCParser.MODE_SET)) {
622 622
 					modestr = modestr + " " + parameter;
623 623
 				}
624 624
 			}
625 625
 		}
626
-		myParser.callDebugInfo(myParser.DEBUG_INFO, "Queueing mode: %s", modestr);
626
+		myParser.callDebugInfo(IRCParser.DEBUG_INFO, "Queueing mode: %s", modestr);
627 627
 		lModeQueue.add(modestr);
628
+		if (lModeQueue.size() == modecount) { sendModes(); }        
628 629
 	}
629 630
 	
630 631
 	/**

+ 2
- 2
test/com/dmdirc/parser/ChannelInfoTest.java View File

@@ -149,7 +149,7 @@ public class ChannelInfoTest extends junit.framework.TestCase {
149 149
         assertEquals(0, parser.sentLines.size());
150 150
     }
151 151
     
152
-    /*@Test
152
+    @Test
153 153
     public void testModeSendFull() {
154 154
         final TestParser parser = new TestParser();
155 155
         final ChannelInfo info = getChannelInfo(parser);
@@ -172,7 +172,7 @@ public class ChannelInfoTest extends junit.framework.TestCase {
172 172
         assertTrue(modes.indexOf('p') > -1);
173 173
         assertTrue(modes.indexOf('t') > -1);
174 174
         assertTrue(modes.indexOf('r') > -1);
175
-    }*/
175
+    }
176 176
     
177 177
     @Test
178 178
     public void testModeSendExtra() {

Loading…
Cancel
Save