check if sender is in contact list before accepting jingle file

This commit is contained in:
Christian Schneppe 2019-11-14 20:51:05 +01:00
parent f5d5be2b3c
commit cccc24c8e2
No known key found for this signature in database
GPG key ID: F30B8D686B44D87E

View file

@ -525,10 +525,11 @@ public class JingleConnection implements Transferable {
//expect the cipher text size. so we just + 16 bytes (auth tag size) here
this.file.setExpectedSize(size + (remoteIsUsingJet ? 16 : 0));
respondToIq(packet, true);
if (mJingleConnectionManager.hasStoragePermission()
if (account.getRoster().getContact(from).showInContactList()
&& mJingleConnectionManager.hasStoragePermission()
&& size < this.mJingleConnectionManager.getAutoAcceptFileSize()
&& mXmppConnectionService.isDataSaverDisabled()) {
Log.d(Config.LOGTAG, "auto accepting file from " + packet.getFrom());
Log.d(Config.LOGTAG, "auto accepting file from " + from);
this.acceptedAutomatically = true;
this.sendAccept();
} else {