Browse Source

Add new parser methods

Change-Id: I942e8363517e48fea26681d1e25b7e6824c27ff5
Depends-On: I0ec15591dcc33c1af55b1267d175ea3abb0178fa
Reviewed-on: http://gerrit.dmdirc.com/1291
Reviewed-by: Gregory Holmes <greg@dmdirc.com>
Automatic-Compile: Chris Smith <chris@dmdirc.com>
tags/0.6.4
Chris Smith 14 years ago
parent
commit
c4e7c90770

+ 9
- 0
src/com/dmdirc/parser/interfaces/Parser.java View File

@@ -383,6 +383,15 @@ public interface Parser extends Runnable {
383 383
      */
384 384
     void sendAction(String target, String message);
385 385
 
386
+    /**
387
+     * Sends an invite to the specified user to join the specified channel.
388
+     *
389
+     * @param channel The channel the user should be invited to
390
+     * @param user The user to be invited to the channel
391
+     * @since 0.6.4
392
+     */
393
+    void sendInvite(String channel, String user);
394
+
386 395
     /**
387 396
      * Retrieves the last line/communication received from the server, for use
388 397
      * in debugging purposes.

+ 12
- 6
src/com/dmdirc/parser/irc/IRCParser.java View File

@@ -958,20 +958,20 @@ public class IRCParser implements SecureParser, Runnable {
958 958
     }
959 959
 
960 960
     /** {@inheritDoc} */
961
-        @Override
961
+    @Override
962 962
     public IRCClientInfo getClient(final String details) {
963 963
         final String sWho = getStringConverter().toLowerCase(IRCClientInfo.parseHost(details));
964 964
         if (clientList.containsKey(sWho)) { return clientList.get(sWho); }
965 965
         else { return new IRCClientInfo(this, details).setFake(true); }
966 966
     }
967 967
 
968
-        public boolean isKnownClient(final String host) {
969
-            final String sWho = getStringConverter().toLowerCase(IRCClientInfo.parseHost(host));
970
-            return clientList.containsKey(sWho);
971
-        }
968
+    public boolean isKnownClient(final String host) {
969
+        final String sWho = getStringConverter().toLowerCase(IRCClientInfo.parseHost(host));
970
+        return clientList.containsKey(sWho);
971
+    }
972 972
 
973 973
     /** {@inheritDoc} */
974
-        @Override
974
+    @Override
975 975
     public IRCChannelInfo getChannel(String channel) {
976 976
         synchronized (channelList) {
977 977
             channel = getStringConverter().toLowerCase(channel);
@@ -979,6 +979,12 @@ public class IRCParser implements SecureParser, Runnable {
979 979
         }
980 980
     }
981 981
 
982
+    /** {@inheritDoc} */
983
+    @Override
984
+    public void sendInvite(final String channel, final String user) {
985
+        sendRawMessage("INVITE " + user + " " + channel);
986
+    }
987
+
982 988
     /** {@inheritDoc} */
983 989
     @Override
984 990
     public void sendRawMessage(final String message) { doSendString(message, QueuePriority.NORMAL, false); }

Loading…
Cancel
Save