diff options
author | Vitaly Takmazov | 2018-02-25 09:46:09 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-03-21 11:45:00 +0300 |
commit | c56aa2e1e475fa482dbfa6d44e927fbb12459a8c (patch) | |
tree | f8ea1a70a3c8b3fd4ce5d599bd60d5f696161f2c /juick-server | |
parent | 9b201b07dc6caa147ea79b359e448f2649353039 (diff) |
xmpp: add some disabled commands
Diffstat (limited to 'juick-server')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/XMPPBot.java | 15 | ||||
-rw-r--r-- | juick-server/src/test/java/com/juick/server/tests/ServerTests.java | 2 |
2 files changed, 12 insertions, 5 deletions
diff --git a/juick-server/src/main/java/com/juick/server/XMPPBot.java b/juick-server/src/main/java/com/juick/server/XMPPBot.java index 6215576a..38f3ed45 100644 --- a/juick-server/src/main/java/com/juick/server/XMPPBot.java +++ b/juick-server/src/main/java/com/juick/server/XMPPBot.java @@ -670,12 +670,19 @@ public class XMPPBot implements StanzaListener, AutoCloseable { return "This is not your reply"; } } - /* - @UserCommand(pattern = "(^(D L|DL|D LAST)$", help = "D #1234/5 - Delete comment", patternFlags = Pattern.CASE_INSENSITIVE) + @UserCommand(pattern = "(^(D L|DL|D LAST)$", help = "D L - Delete last message", patternFlags = Pattern.CASE_INSENSITIVE) public String commandDeleteLast(User user, Jid from, String... args) { - + return "Temporarily unavailable"; + } + @UserCommand(pattern = "^\\?\\s+\\@([a-zA-Z0-9\\-\\.\\@]+)\\s+([\\s\\S]+)$", help = "? @user string - search in user messages") + public String commandSearch(User user, Jid from, String... args) { + return "Temporarily unavailable"; } - */ + @UserCommand(pattern = "^\\?\\s+([\\s\\S]+)$", help = "? string - search in all messages") + public String commandSearchAll(User user, Jid from, String... args) { + return "Temporarily unavailable"; + } + void sendReply(Jid jidTo, String txt) { Message reply = new Message(); reply.setFrom(jid); diff --git a/juick-server/src/test/java/com/juick/server/tests/ServerTests.java b/juick-server/src/test/java/com/juick/server/tests/ServerTests.java index 4bf8ac9e..9b985543 100644 --- a/juick-server/src/test/java/com/juick/server/tests/ServerTests.java +++ b/juick-server/src/test/java/com/juick/server/tests/ServerTests.java @@ -385,7 +385,7 @@ public class ServerTests extends AbstractJUnit4SpringContextTests { public void botCommandsTests() throws IllegalAccessException, NoSuchMethodException, InvocationTargetException { assertThat(bot.processCommand(new User(), Jid.of("test@localhost"), "PING").get(), is("PONG")); // subscription commands have two lines, others have 1 - assertThat(bot.processCommand(new User(), Jid.of("test@localhost"), "help").get().split("\n").length, is(25)); + assertThat(bot.processCommand(new User(), Jid.of("test@localhost"), "help").get().split("\n").length, is(28)); } @Test |