use of eu.siacs.conversations.xmpp.jingle.stanzas.FileTransferDescription in project Conversations by siacs.
the class JingleFileTransferConnection method setupDescription.
private void setupDescription(final FileTransferDescription.Version version) {
this.file = this.xmppConnectionService.getFileBackend().getFile(message, false);
final FileTransferDescription description;
if (message.getEncryption() == Message.ENCRYPTION_AXOLOTL) {
this.file.setKey(mXmppAxolotlMessage.getInnerKey());
this.file.setIv(mXmppAxolotlMessage.getIV());
// legacy OMEMO encrypted file transfer reported file size of the encrypted file
// JET uses the file size of the plain text file. The difference is only 16 bytes (auth tag)
this.file.setExpectedSize(file.getSize() + (this.remoteSupportsOmemoJet ? 0 : 16));
if (remoteSupportsOmemoJet) {
description = FileTransferDescription.of(this.file, version, null);
} else {
description = FileTransferDescription.of(this.file, version, this.mXmppAxolotlMessage);
}
} else {
this.file.setExpectedSize(file.getSize());
description = FileTransferDescription.of(this.file, version, null);
}
this.description = description;
}
Aggregations