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.
This commit is contained in:
parent
2045a71262
commit
9c4d55f82c
|
@ -961,8 +961,14 @@ public class AxolotlService {
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public XmppAxolotlMessage encrypt(Message message ){
|
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(),
|
final XmppAxolotlMessage axolotlMessage = new XmppAxolotlMessage(message.getContact().getJid().toBareJid(),
|
||||||
getOwnDeviceId(), message.getBody());
|
getOwnDeviceId(), content);
|
||||||
|
|
||||||
if(findSessionsforContact(message.getContact()).isEmpty()) {
|
if(findSessionsforContact(message.getContact()).isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in New Issue