aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server/ServerManager.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-02-15 10:50:40 +0300
committerGravatar Vitaly Takmazov2018-02-15 10:50:40 +0300
commitf764bb226f0db20a4e4c2258f2304e93f1a47557 (patch)
tree961f9b0ae2e661ce1d688aa57a3588ed5b6f64d7 /juick-server/src/main/java/com/juick/server/ServerManager.java
parent775fead48969047e9770b325a3b6a25bbad35835 (diff)
server: handle messages from service ws user
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/ServerManager.java')
-rw-r--r--juick-server/src/main/java/com/juick/server/ServerManager.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/juick-server/src/main/java/com/juick/server/ServerManager.java b/juick-server/src/main/java/com/juick/server/ServerManager.java
index 79ccb1e4..1db31e23 100644
--- a/juick-server/src/main/java/com/juick/server/ServerManager.java
+++ b/juick-server/src/main/java/com/juick/server/ServerManager.java
@@ -164,13 +164,18 @@ public class ServerManager implements AutoCloseable {
xmsg.setBody(body);
try {
if (StringUtils.isNotEmpty(attachmentName)) {
- String attachmentUrl = String.format("juick://%s", attachmentName);
- xmsg.addExtension(new OobX(new URI(attachmentUrl), "!!!!Juick!!"));
+ URI httpUri = URI.create(attachmentName);
+ if (httpUri.isAbsolute()) {
+ xmsg.addExtension(new OobX(httpUri));
+ } else {
+ String attachmentUrl = String.format("juick://%s", attachmentName);
+ xmsg.addExtension(new OobX(new URI(attachmentUrl), "!!!!Juick!!"));
+ }
}
- sendMessage(xmsg);
} catch (URISyntaxException e1) {
logger.warn("attachment error", e1);
}
+ sendMessage(xmsg);
}
private void onJuickPM(final int uid_to, final com.juick.Message jmsg) throws JsonProcessingException {