aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/http
diff options
context:
space:
mode:
authorChristian S <christian@pix-art.de>2016-03-26 11:17:48 +0100
committerChristian S <christian@pix-art.de>2016-03-26 11:17:48 +0100
commit927dde01a827a91a24495bd868575cefd981f8c2 (patch)
treef09ed178937f28b85d1499951cff3faa64988250 /src/main/java/eu/siacs/conversations/http
parent67eb44af3c5012cdc2da3af4ae94cf7fa51a3ef1 (diff)
parent46be514b4db1cb8c17037ac6cd307078e4794a12 (diff)
Merge branch 'siacs/master' into development
Diffstat (limited to 'src/main/java/eu/siacs/conversations/http')
-rw-r--r--src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java12
-rw-r--r--src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java9
2 files changed, 3 insertions, 18 deletions
diff --git a/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java b/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java
index 84a44715b..d23cb71a3 100644
--- a/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java
+++ b/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java
@@ -1,7 +1,5 @@
package eu.siacs.conversations.http;
-import android.content.Intent;
-import android.net.Uri;
import android.os.PowerManager;
import android.util.Log;
@@ -10,12 +8,8 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
import java.net.MalformedURLException;
-import java.net.Proxy;
import java.net.URL;
-import java.util.Arrays;
import java.util.concurrent.CancellationException;
import javax.net.ssl.HttpsURLConnection;
@@ -94,7 +88,7 @@ public class HttpDownloadConnection implements Transferable {
} else {
extension = lastPart;
}
- message.setRelativeFilePath(message.getUuid()+"."+extension);
+ message.setRelativeFilePath(message.getUuid() + "." + extension);
this.file = mXmppConnectionService.getFileBackend().getFile(message, false);
String reference = mUrl.getRef();
if (reference != null && reference.length() == 96) {
@@ -129,9 +123,7 @@ public class HttpDownloadConnection implements Transferable {
}
private void finish() {
- Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
- intent.setData(Uri.fromFile(file));
- mXmppConnectionService.sendBroadcast(intent);
+ mXmppConnectionService.getFileBackend().updateMediaScanner(file);
message.setTransferable(null);
mHttpConnectionManager.finishConnection(this);
if (message.getEncryption() == Message.ENCRYPTION_PGP) {
diff --git a/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java b/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java
index c1bc897d7..df3740ff7 100644
--- a/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java
+++ b/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java
@@ -1,8 +1,6 @@
package eu.siacs.conversations.http;
import android.app.PendingIntent;
-import android.content.Intent;
-import android.net.Uri;
import android.os.PowerManager;
import android.util.Log;
import android.util.Pair;
@@ -12,10 +10,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
import java.net.MalformedURLException;
-import java.net.Proxy;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
@@ -200,9 +195,7 @@ public class HttpUploadConnection implements Transferable {
mGetUrl = new URL(mGetUrl.toString() + "#" + CryptoHelper.bytesToHex(key));
}
mXmppConnectionService.getFileBackend().updateFileParams(message, mGetUrl);
- Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
- intent.setData(Uri.fromFile(file));
- mXmppConnectionService.sendBroadcast(intent);
+ mXmppConnectionService.getFileBackend().updateMediaScanner(file);
message.setTransferable(null);
message.setCounterpart(message.getConversation().getJid().toBareJid());
if (message.getEncryption() == Message.ENCRYPTION_DECRYPTED) {