Browse Source

Fixes issue 0003497: LISTMODE should fire one callback for each list mode type retrieved

Change-Id: I0e3b0aa861b1f7e6da1e033708ca77ff6f0a399b
Reviewed-on: http://gerrit.dmdirc.com/472
Reviewed-by: Chris Smith <chris@dmdirc.com>
Automatic-Compile: Shane Mc Cormack <shane@dmdirc.com>
tags/0.6.3
Shane Mc Cormack 14 years ago
parent
commit
d0f3dd65ba

+ 2
- 1
src/com/dmdirc/parser/interfaces/callbacks/ChannelListModeListener.java View File

@@ -38,7 +38,8 @@ public interface ChannelListModeListener extends CallbackInterface {
38 38
 	 *
39 39
 	 * @param tParser Reference to the parser object that made the callback.
40 40
 	 * @param cChannel Channel which the ListModes reply is for
41
+         * @param mode the Mode the ListMOdes reply is for.
41 42
 	 * @see com.dmdirc.parser.irc.ProcessListModes#callChannelGotListModes
42 43
 	 */
43
-	void onChannelGotListModes(Parser tParser, ChannelInfo cChannel);
44
+	void onChannelGotListModes(Parser tParser, ChannelInfo cChannel, char mode);
44 45
 }

+ 13
- 3
src/com/dmdirc/parser/irc/ProcessListModes.java View File

@@ -208,7 +208,16 @@ public class ProcessListModes extends IRCProcessor {
208 208
             if (isCleverMode || listModeQueue == null || ((LinkedList<Character>)listModeQueue).size() == 0) {
209 209
                 callDebugInfo(IRCParser.DEBUG_INFO, "Calling GotListModes");
210 210
                 channel.setHasGotListModes(true);
211
-                callChannelGotListModes(channel);
211
+
212
+                if (isCleverMode) {
213
+                    for (Character thisMode : myParser.chanModesOther.keySet()) {
214
+                        if (myParser.chanModesOther.get(thisMode) == IRCParser.MODE_LIST) {
215
+                            callChannelGotListModes(channel, thisMode);
216
+                        }
217
+                    }
218
+                } else {
219
+                    callChannelGotListModes(channel, mode);
220
+                }
212 221
             }
213 222
         }
214 223
     }
@@ -237,10 +246,11 @@ public class ProcessListModes extends IRCProcessor {
237 246
      *
238 247
      * @see IChannelGotListModes
239 248
      * @param cChannel Channel which the ListModes reply is for
249
+     * @param mode the mode that we got list modes for.
240 250
      * @return true if a method was called, false otherwise
241 251
      */
242
-    protected boolean callChannelGotListModes(ChannelInfo cChannel) {
243
-        return getCallbackManager().getCallbackType(ChannelListModeListener.class).call(cChannel);
252
+    protected boolean callChannelGotListModes(ChannelInfo cChannel, final char mode) {
253
+        return getCallbackManager().getCallbackType(ChannelListModeListener.class).call(cChannel, mode);
244 254
     }
245 255
     
246 256
     /**

Loading…
Cancel
Save