aboutsummaryrefslogtreecommitdiff
path: root/juick-server-xmpp/src/main/java/com/juick/server/CommandsManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server-xmpp/src/main/java/com/juick/server/CommandsManager.java')
-rw-r--r--juick-server-xmpp/src/main/java/com/juick/server/CommandsManager.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/juick-server-xmpp/src/main/java/com/juick/server/CommandsManager.java b/juick-server-xmpp/src/main/java/com/juick/server/CommandsManager.java
index 6458382f..26dafa69 100644
--- a/juick-server-xmpp/src/main/java/com/juick/server/CommandsManager.java
+++ b/juick-server-xmpp/src/main/java/com/juick/server/CommandsManager.java
@@ -44,9 +44,7 @@ import javax.annotation.PostConstruct;
import javax.inject.Inject;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import java.net.MalformedURLException;
import java.net.URI;
-import java.nio.file.Paths;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -470,7 +468,7 @@ public class CommandsManager {
int newrid = messagesService.createReply(mid, rid, user.getUid(), txt, attachmentType);
if (StringUtils.isNotEmpty(attachmentType)) {
String attachmentFName = attachment.getScheme().equals("juick") ? attachment.getHost()
- : HttpUtils.downloadImage(attachment.toURL(), tmpDir);
+ : HttpUtils.downloadImage(attachment.toURL(), tmpDir).getHost();
String fname = String.format("%d-%d.%s", mid, newrid, attachmentType);
ImageUtils.saveImageWithPreviews(attachmentFName, fname, tmpDir, imgDir);
}