aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/server
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-01-30 09:48:40 +0300
committerGravatar Vitaly Takmazov2019-01-30 09:48:40 +0300
commit996e58b2611fd1c2d3a18222b1683335753da680 (patch)
treea84f420fe35a2380c97476dff819470f69daeb35 /src/main/java/com/juick/server
parent8bcb61d239a9c56641d60b861a92c1a339994e52 (diff)
Do not modify replies without attachments
Diffstat (limited to 'src/main/java/com/juick/server')
-rw-r--r--src/main/java/com/juick/server/CommandsManager.java6
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);
}