mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-11 15:07:46 +00:00
Identity functionality and data structure are completely removed.
This commit is contained in:
@@ -117,7 +117,7 @@ public class SignalServiceMessageReceiver {
|
||||
public InputStream retrieveProfileAvatar(String path, File destination, byte[] profileKey, int maxSizeBytes)
|
||||
throws IOException
|
||||
{
|
||||
DownloadUtilities.INSTANCE.downloadFile(destination, path, maxSizeBytes, null);
|
||||
DownloadUtilities.downloadFile(destination, path, maxSizeBytes, null);
|
||||
return new ProfileCipherInputStream(new FileInputStream(destination), profileKey);
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ public class SignalServiceMessageReceiver {
|
||||
{
|
||||
// Loki - Fetch attachment
|
||||
if (pointer.getUrl().isEmpty()) throw new InvalidMessageException("Missing attachment URL.");
|
||||
DownloadUtilities.INSTANCE.downloadFile(destination, pointer.getUrl(), maxSizeBytes, listener);
|
||||
DownloadUtilities.downloadFile(destination, pointer.getUrl(), maxSizeBytes, listener);
|
||||
|
||||
// Loki - Assume we're retrieving an attachment for an open group server if the digest is not set
|
||||
if (!pointer.getDigest().isPresent()) { return new FileInputStream(destination); }
|
||||
|
@@ -16,6 +16,7 @@ object DownloadUtilities {
|
||||
/**
|
||||
* Blocks the calling thread.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun downloadFile(destination: File, url: String, maxSize: Int, listener: SignalServiceAttachment.ProgressListener?) {
|
||||
val outputStream = FileOutputStream(destination) // Throws
|
||||
var remainingAttempts = 4
|
||||
@@ -36,6 +37,7 @@ object DownloadUtilities {
|
||||
/**
|
||||
* Blocks the calling thread.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun downloadFile(outputStream: OutputStream, url: String, maxSize: Int, listener: SignalServiceAttachment.ProgressListener?) {
|
||||
// We need to throw a PushNetworkException or NonSuccessfulResponseCodeException
|
||||
// because the underlying Signal logic requires these to work correctly
|
||||
|
Reference in New Issue
Block a user