diff options
author | Vitaly Takmazov | 2019-01-30 09:48:40 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2019-01-30 09:48:40 +0300 |
commit | 996e58b2611fd1c2d3a18222b1683335753da680 (patch) | |
tree | a84f420fe35a2380c97476dff819470f69daeb35 /src/main/java/com/juick | |
parent | 8bcb61d239a9c56641d60b861a92c1a339994e52 (diff) |
Do not modify replies without attachments
Diffstat (limited to 'src/main/java/com/juick')
-rw-r--r-- | src/main/java/com/juick/server/CommandsManager.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/com/juick/server/CommandsManager.java b/src/main/java/com/juick/server/CommandsManager.java index 1c726e60..08dafe77 100644 --- a/src/main/java/com/juick/server/CommandsManager.java +++ b/src/main/java/com/juick/server/CommandsManager.java @@ -542,10 +542,10 @@ public class CommandsManager { } } } - boolean attachmentDownloaded = StringUtils.isNotEmpty(attachmentType); - String messageText = attachmentDownloaded ? txt : String.format("%s %s", txt, attachment.toASCIIString()); + boolean attachmentProcessed = !haveAttachment || StringUtils.isNotEmpty(attachmentType); + String messageText = attachmentProcessed ? txt : String.format("%s %s", txt, attachment.toASCIIString()); int newrid = messagesService.createReply(mid, rid, user, messageText, attachmentType); - if (attachmentDownloaded) { + if (haveAttachment && attachmentProcessed) { String fname = String.format("%d-%d.%s", mid, newrid, attachmentType); imagesService.saveImageWithPreviews(attachmentFName, fname); } |