diff options
Diffstat (limited to 'juick-xmpp/src/main/java/com')
-rw-r--r-- | juick-xmpp/src/main/java/com/juick/components/XMPPConnection.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/juick-xmpp/src/main/java/com/juick/components/XMPPConnection.java b/juick-xmpp/src/main/java/com/juick/components/XMPPConnection.java index 8a3beb6a..edf2d0f3 100644 --- a/juick-xmpp/src/main/java/com/juick/components/XMPPConnection.java +++ b/juick-xmpp/src/main/java/com/juick/components/XMPPConnection.java @@ -17,6 +17,7 @@ package com.juick.components; +import com.juick.Attachment; import com.juick.User; import com.juick.components.s2s.BasicXmppSession; import com.juick.server.helpers.UserInfo; @@ -287,9 +288,9 @@ public class XMPPConnection implements AutoCloseable { } com.juick.Message fullMsg = messagesService.getMessage(jmsg.getMid()); String txt = "@" + jmsg.getUser().getName() + ":" + fullMsg.getTagsString() + "\n"; - String attachment = fullMsg.getAttachment().getMedium().getUrl(); + Attachment attachment = fullMsg.getAttachment(); if (attachment != null) { - txt += attachment + "\n"; + txt += attachment.getMedium().getUrl() + "\n"; } txt += jmsg.getText() + "\n\n"; txt += "#" + jmsg.getMid() + " http://juick.com/" + jmsg.getMid(); @@ -305,7 +306,7 @@ public class XMPPConnection implements AutoCloseable { msg.addExtension(nick); if (attachment != null) { try { - OobX oob = new OobX(new URI(attachment)); + OobX oob = new OobX(new URI(attachment.getMedium().getUrl())); msg.addExtension(oob); } catch (URISyntaxException e) { logger.warn("uri exception", e); @@ -330,9 +331,9 @@ public class XMPPConnection implements AutoCloseable { replyQuote = fullReply.getReplyQuote(); String txt = "Reply by @" + jmsg.getUser().getName() + ":\n" + replyQuote + "\n@" + replyTo + " "; - String attachment = jmsg.getAttachment().getMedium().getUrl(); + Attachment attachment = jmsg.getAttachment(); if (attachment != null) { - txt += attachment + "\n"; + txt += attachment.getMedium().getUrl() + "\n"; } txt += jmsg.getText() + "\n\n" + "#" + jmsg.getMid() + "/" + jmsg.getRid() + " http://juick.com/" + jmsg.getMid() + "#" + jmsg.getRid(); @@ -357,9 +358,9 @@ public class XMPPConnection implements AutoCloseable { String txt = "Recommended by @" + recomm.getUser().getName() + ":\n"; txt += "@" + jmsg.getUser().getName() + ":" + jmsg.getTagsString() + "\n"; - String attachment = jmsg.getAttachment().getMedium().getUrl(); + Attachment attachment = jmsg.getAttachment(); if (attachment != null) { - txt += attachment + "\n"; + txt += attachment.getMedium().getUrl() + "\n"; } txt += jmsg.getText() + "\n\n"; txt += "#" + jmsg.getMid(); @@ -383,7 +384,7 @@ public class XMPPConnection implements AutoCloseable { msg.addExtension(nick); if (attachment != null) { try { - OobX oob = new OobX(new URI(attachment)); + OobX oob = new OobX(new URI(attachment.getMedium().getUrl())); msg.addExtension(oob); } catch (URISyntaxException e) { logger.warn("uri exception", e); |