diff options
Diffstat (limited to 'juick-server/src/main/java/com')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/XMPPBot.java | 12 |
1 files changed, 11 insertions, 1 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 1c17a0aa..a07dbe86 100644 --- a/juick-server/src/main/java/com/juick/server/XMPPBot.java +++ b/juick-server/src/main/java/com/juick/server/XMPPBot.java @@ -617,10 +617,20 @@ public class XMPPBot implements StanzaListener, AutoCloseable { return String.join("\n", replies.stream().map(PlainTextFormatter::formatPostSummary).collect(Collectors.toList())); } - return PlainTextFormatter.formatPostSummary(msg); + return PlainTextFormatter.formatPost(msg); } return "Message not found"; } + @UserCommand(pattern = "^#(\\d+)\\/(\\d+)$", help = "#1234/5 - Show reply") + public String commandShowReply(User user, Jid from, String... arguments) { + int mid = NumberUtils.toInt(arguments[0], 0); + int rid = NumberUtils.toInt(arguments[1], 0); + com.juick.Message reply = messagesService.getReply(mid, rid); + if (reply != null) { + return PlainTextFormatter.formatPost(reply); + } + return "Reply not found"; + } @UserCommand(pattern = "^D #(\\d+)$", help = "D #1234 - Delete post", patternFlags = Pattern.CASE_INSENSITIVE) public String commandDeletePost(User user, Jid from, String... args) { int mid = Integer.valueOf(args[0]); |