From 767aec7729a326ff1ccc225d8623a24dd1e698d5 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 5 Apr 2018 22:17:57 +0300 Subject: server: markdown command reply * also fixes new messages with one tag and attachment --- .../main/java/com/juick/server/helpers/CommandResult.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'juick-common/src/main/java/com/juick/server/helpers') 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 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) { -- cgit v1.2.3