aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorAndreas Straub <andy@strb.org>2015-07-17 19:44:45 +0200
committerAndreas Straub <andy@strb.org>2015-07-19 22:23:28 +0200
commit9c4d55f82ce50391ac09b4f7d7a0f3576c014e56 (patch)
tree018699c09b5bb504d50ffe56952c5808016c3482 /src/main
parent2045a7126242ef7656a38e445b636ae87d4b763e (diff)
Send correct body for HTTP files
When using HTTP upload to send files, take care to transmit only the URL rather than the entire body, which contains metadata.
Diffstat (limited to '')
-rw-r--r--src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java
index 57e57f7f..8358125d 100644
--- a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java
+++ b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java
@@ -961,8 +961,14 @@ public class AxolotlService {
@Nullable
public XmppAxolotlMessage encrypt(Message message ){
+ final String content;
+ if (message.hasFileOnRemoteHost()) {
+ content = message.getFileParams().url.toString();
+ } else {
+ content = message.getBody();
+ }
final XmppAxolotlMessage axolotlMessage = new XmppAxolotlMessage(message.getContact().getJid().toBareJid(),
- getOwnDeviceId(), message.getBody());
+ getOwnDeviceId(), content);
if(findSessionsforContact(message.getContact()).isEmpty()) {
return null;