aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/server
diff options
context:
space:
mode:
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);
}