aboutsummaryrefslogtreecommitdiff
path: root/juick-common/src/main/java/com/juick/server/helpers
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-04-05 22:17:57 +0300
committerGravatar Vitaly Takmazov2018-04-05 22:17:57 +0300
commit767aec7729a326ff1ccc225d8623a24dd1e698d5 (patch)
treec694fc17767170200888a3348acebed67afe5e06 /juick-common/src/main/java/com/juick/server/helpers
parent0cd08c7161fd3b5fe54d90b01ea35360ea5390dc (diff)
server: markdown command reply
* also fixes new messages with one tag and attachment
Diffstat (limited to 'juick-common/src/main/java/com/juick/server/helpers')
-rw-r--r--juick-common/src/main/java/com/juick/server/helpers/CommandResult.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/juick-common/src/main/java/com/juick/server/helpers/CommandResult.java b/juick-common/src/main/java/com/juick/server/helpers/CommandResult.java
index 29244115..a772153b 100644
--- a/juick-common/src/main/java/com/juick/server/helpers/CommandResult.java
+++ b/juick-common/src/main/java/com/juick/server/helpers/CommandResult.java
@@ -2,21 +2,28 @@ package com.juick.server.helpers;
import com.juick.Message;
+import java.util.Optional;
+
public class CommandResult {
private String text;
+ private String markdown;
private Message newMessage;
public String getText() {
return text;
}
+ public String getMarkdown() {
+ return markdown;
+ }
- public Message getNewMessage() {
- return newMessage;
+ public Optional<Message> getNewMessage() {
+ return Optional.of(newMessage);
}
- public static CommandResult fromMessage(Message newMessage, String text) {
+ public static CommandResult build(Message newMessage, String text, String markdown) {
CommandResult result = new CommandResult();
result.newMessage = newMessage;
result.text = text;
+ result.markdown = markdown;
return result;
}
public static CommandResult fromString(String text) {