Browse Source

Expose ChannelInfo.requestListModes

Fix some minor javadoc errors
Fixes issue 3499

Change-Id: I80de1df17532e9ab6c3c5cf4884a946d2046702e
Reviewed-on: http://gerrit.dmdirc.com/471
Reviewed-by: Shane Mc Cormack <shane@dmdirc.com>
Tested-by: Shane Mc Cormack <shane@dmdirc.com>
tags/0.6.3
Chris Smith 14 years ago
parent
commit
d5500414d2

+ 7
- 0
src/com/dmdirc/parser/interfaces/ChannelInfo.java View File

@@ -139,6 +139,13 @@ public interface ChannelInfo {
139 139
      */
140 140
     void flushModes();
141 141
 
142
+    /**
143
+     * Ask the server for all the list modes for this channel.
144
+     *
145
+     * @since 0.6.3
146
+     */
147
+    void requestListModes();
148
+
142 149
     /**
143 150
      * Retrieves a channel client information object corresponding to the
144 151
      * specified client.

+ 29
- 28
src/com/dmdirc/parser/irc/IRCChannelInfo.java View File

@@ -130,6 +130,7 @@ public class IRCChannelInfo implements ChannelInfo {
130 130
     /**
131 131
      * Ask the server for all the list modes for this channel.
132 132
      */
133
+    @Override
133 134
     public void requestListModes() {
134 135
         final IRCChannelClientInfo me = getChannelClient(myParser.getLocalClient());
135 136
                 
@@ -293,31 +294,31 @@ public class IRCChannelInfo implements ChannelInfo {
293 294
     }
294 295
 
295 296
     /** {@inheritDoc} */
296
-        @Override
297
-    public IRCChannelClientInfo getChannelClient(final String sWho) {
298
-        return getChannelClient(sWho, false);
297
+    @Override
298
+    public IRCChannelClientInfo getChannelClient(final String client) {
299
+        return getChannelClient(client, false);
299 300
     }
300 301
     
301 302
     /** {@inheritDoc} */
302
-        @Override
303
-    public IRCChannelClientInfo getChannelClient(final String sWho, final boolean createFake) {
304
-        final String who = myParser.getStringConverter().toLowerCase(IRCClientInfo.parseHost(sWho));
303
+    @Override
304
+    public IRCChannelClientInfo getChannelClient(final String client, final boolean create) {
305
+        final String who = myParser.getStringConverter().toLowerCase(IRCClientInfo.parseHost(client));
305 306
         if (hChannelUserList.containsKey(who)) {
306 307
             return hChannelUserList.get(who);
307 308
         }
308
-        if (createFake) {
309
-            return new IRCChannelClientInfo(myParser, (new IRCClientInfo(myParser, sWho)).setFake(true), this);
309
+        if (create) {
310
+            return new IRCChannelClientInfo(myParser, (new IRCClientInfo(myParser, client)).setFake(true), this);
310 311
         } else {
311 312
             return null;
312 313
         }
313 314
     }
314 315
     
315 316
     /** {@inheritDoc} */
316
-        @Override
317
-    public IRCChannelClientInfo getChannelClient(final ClientInfo cWho) {
318
-        for (IRCChannelClientInfo client : hChannelUserList.values()) {
319
-            if (client.getClient() == cWho) {
320
-                return client;
317
+    @Override
318
+    public IRCChannelClientInfo getChannelClient(final ClientInfo client) {
319
+        for (IRCChannelClientInfo target : hChannelUserList.values()) {
320
+            if (target.getClient() == client) {
321
+                return target;
321 322
             }
322 323
         }
323 324
         return null;
@@ -474,9 +475,9 @@ public class IRCChannelInfo implements ChannelInfo {
474 475
         
475 476
     /** {@inheritDoc} */
476 477
         @Override
477
-    public String getMode(final char cMode) {
478
-        if (hParamModes.containsKey(cMode)) { 
479
-            return hParamModes.get(cMode); 
478
+    public String getMode(final char mode) {
479
+        if (hParamModes.containsKey(mode)) {
480
+            return hParamModes.get(mode);
480 481
         }
481 482
         return "";
482 483
     }
@@ -526,13 +527,13 @@ public class IRCChannelInfo implements ChannelInfo {
526 527
     
527 528
     /** {@inheritDoc} */
528 529
         @Override
529
-    public Collection<ChannelListModeItem> getListMode(final char cMode) {
530
-        if (!myParser.chanModesOther.containsKey(cMode) || myParser.chanModesOther.get(cMode) != IRCParser.MODE_LIST) { return null; }
530
+    public Collection<ChannelListModeItem> getListMode(final char mode) {
531
+        if (!myParser.chanModesOther.containsKey(mode) || myParser.chanModesOther.get(mode) != IRCParser.MODE_LIST) { return null; }
531 532
         
532
-        if (!hListModes.containsKey(cMode)) { 
533
-            hListModes.put(cMode, new ArrayList<ChannelListModeItem>());
533
+        if (!hListModes.containsKey(mode)) {
534
+            hListModes.put(mode, new ArrayList<ChannelListModeItem>());
534 535
         }
535
-        return hListModes.get(cMode);
536
+        return hListModes.get(mode);
536 537
     }
537 538
     
538 539
     /**
@@ -573,8 +574,8 @@ public class IRCChannelInfo implements ChannelInfo {
573 574
     }
574 575
     
575 576
     /** {@inheritDoc} */
576
-        @Override
577
-    public void alterMode(final boolean positive, final Character mode, final String parameter) { 
577
+    @Override
578
+    public void alterMode(final boolean add, final Character mode, final String parameter) {
578 579
         int modecount = 1;
579 580
         int modeint = 0;
580 581
         String modestr = "";
@@ -591,9 +592,9 @@ public class IRCChannelInfo implements ChannelInfo {
591 592
         }
592 593
         if (!myParser.isUserSettable(mode)) { return; }
593 594
 
594
-        modestr = ((positive) ? "+" : "-") + mode;
595
+        modestr = ((add) ? "+" : "-") + mode;
595 596
         if (myParser.chanModesBool.containsKey(mode)) {
596
-            final String teststr = ((positive) ? "-" : "+") + mode;
597
+            final String teststr = ((add) ? "-" : "+") + mode;
597 598
             if (lModeQueue.contains(teststr)) {
598 599
                 lModeQueue.remove(teststr);
599 600
                 return;
@@ -608,9 +609,9 @@ public class IRCChannelInfo implements ChannelInfo {
608 609
                 modeint = myParser.chanModesOther.get(mode);
609 610
                 if ((modeint & IRCParser.MODE_LIST) == IRCParser.MODE_LIST) {
610 611
                     modestr = modestr + " " + parameter;
611
-                } else if (!positive && ((modeint & IRCParser.MODE_UNSET) == IRCParser.MODE_UNSET)) {
612
+                } else if (!add && ((modeint & IRCParser.MODE_UNSET) == IRCParser.MODE_UNSET)) {
612 613
                     modestr = modestr + " " + parameter;
613
-                } else if (positive && ((modeint & IRCParser.MODE_SET) == IRCParser.MODE_SET)) {
614
+                } else if (add && ((modeint & IRCParser.MODE_SET) == IRCParser.MODE_SET)) {
614 615
                     // Does mode require a param to unset aswell?
615 616
                     // We might need to queue an unset first
616 617
                     if (((modeint & IRCParser.MODE_UNSET) == IRCParser.MODE_UNSET)) {
@@ -626,7 +627,7 @@ public class IRCChannelInfo implements ChannelInfo {
626 627
                     modestr = modestr + " " + parameter;
627 628
                 }
628 629
             } else {
629
-                myParser.callErrorInfo(new ParserError(ParserError.ERROR_WARNING, "Trying to alter unknown mode.  positive: '"+positive+"' | mode: '"+mode+"' | parameter: '"+parameter+"' ", ""));
630
+                myParser.callErrorInfo(new ParserError(ParserError.ERROR_WARNING, "Trying to alter unknown mode.  positive: '"+add+"' | mode: '"+mode+"' | parameter: '"+parameter+"' ", ""));
630 631
             }
631 632
         }
632 633
         myParser.callDebugInfo(IRCParser.DEBUG_INFO, "Queueing mode: %s", modestr);

Loading…
Cancel
Save