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
     public static final String VERSION = "SVN";
53
     public static final String VERSION = "SVN";
54
 
54
 
55
     /** The SVN revision that this build was made from. */
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
     /** Stores the update channel that this version came from, if any. */
58
     /** Stores the update channel that this version came from, if any. */
59
     public static final UpdateChannel UPDATE_CHANNEL = UpdateChannel.NONE;
59
     public static final UpdateChannel UPDATE_CHANNEL = UpdateChannel.NONE;

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

605
 			}
605
 			}
606
 		}
606
 		}
607
 		if (!myParser.isUserSettable(mode)) { return; }
607
 		if (!myParser.isUserSettable(mode)) { return; }
608
-		if (lModeQueue.size() == modecount) { sendModes(); }
608
+
609
 		if (positive) { modestr = "+"; } else { modestr = "-"; }
609
 		if (positive) { modestr = "+"; } else { modestr = "-"; }
610
 		modestr = modestr + mode;
610
 		modestr = modestr + mode;
611
 		if (!myParser.hChanModesBool.containsKey(mode)) {
611
 		if (!myParser.hChanModesBool.containsKey(mode)) {
614
 				modestr = modestr + " " + parameter;
614
 				modestr = modestr + " " + parameter;
615
 			} else {
615
 			} else {
616
 				modecount = myParser.hChanModesOther.get(mode);
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
 					modestr = modestr + " " + parameter;
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
 					modestr = modestr + " " + parameter;
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
 					modestr = modestr + " " + parameter;
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
 		lModeQueue.add(modestr);
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
         assertEquals(0, parser.sentLines.size());
149
         assertEquals(0, parser.sentLines.size());
150
     }
150
     }
151
     
151
     
152
-    /*@Test
152
+    @Test
153
     public void testModeSendFull() {
153
     public void testModeSendFull() {
154
         final TestParser parser = new TestParser();
154
         final TestParser parser = new TestParser();
155
         final ChannelInfo info = getChannelInfo(parser);
155
         final ChannelInfo info = getChannelInfo(parser);
172
         assertTrue(modes.indexOf('p') > -1);
172
         assertTrue(modes.indexOf('p') > -1);
173
         assertTrue(modes.indexOf('t') > -1);
173
         assertTrue(modes.indexOf('t') > -1);
174
         assertTrue(modes.indexOf('r') > -1);
174
         assertTrue(modes.indexOf('r') > -1);
175
-    }*/
175
+    }
176
     
176
     
177
     @Test
177
     @Test
178
     public void testModeSendExtra() {
178
     public void testModeSendExtra() {

Loading…
Cancel
Save