mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-06 20:31:56 +00:00
committed by
Moxie Marlinspike
parent
e83827ab75
commit
946c43940b
@@ -2,6 +2,7 @@ package org.thoughtcrime.securesms.mms;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
import com.bumptech.glide.load.data.DataFetcher;
|
||||
import com.bumptech.glide.load.model.GenericLoaderFactory;
|
||||
@@ -51,13 +52,29 @@ public class AttachmentStreamUriLoader implements StreamModelLoader<AttachmentMo
|
||||
}
|
||||
|
||||
public static class AttachmentModel {
|
||||
public File attachment;
|
||||
public byte[] key;
|
||||
public @NonNull File attachment;
|
||||
public @NonNull byte[] key;
|
||||
|
||||
public AttachmentModel(File attachment, byte[] key) {
|
||||
public AttachmentModel(@NonNull File attachment, @NonNull byte[] key) {
|
||||
this.attachment = attachment;
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
AttachmentModel that = (AttachmentModel)o;
|
||||
|
||||
return attachment.equals(that.attachment);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return attachment.hashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.thoughtcrime.securesms.mms;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
import com.bumptech.glide.load.data.DataFetcher;
|
||||
import com.bumptech.glide.load.model.GenericLoaderFactory;
|
||||
@@ -48,13 +49,29 @@ public class DecryptableStreamUriLoader implements StreamModelLoader<Decryptable
|
||||
}
|
||||
|
||||
public static class DecryptableUri {
|
||||
public MasterSecret masterSecret;
|
||||
public Uri uri;
|
||||
public @NonNull MasterSecret masterSecret;
|
||||
public @NonNull Uri uri;
|
||||
|
||||
public DecryptableUri(MasterSecret masterSecret, Uri uri) {
|
||||
public DecryptableUri(@NonNull MasterSecret masterSecret, @NonNull Uri uri) {
|
||||
this.masterSecret = masterSecret;
|
||||
this.uri = uri;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
DecryptableUri that = (DecryptableUri)o;
|
||||
|
||||
return uri.equals(that.uri);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return uri.hashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user