mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-23 18:40:32 +00:00
Update signal-service
// FREEBIE
This commit is contained in:
@@ -39,8 +39,9 @@ import javax.inject.Inject;
|
||||
import ws.com.google.android.mms.MmsException;
|
||||
|
||||
public class AttachmentDownloadJob extends MasterSecretJob implements InjectableType {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final String TAG = AttachmentDownloadJob.class.getSimpleName();
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final int MAX_ATTACHMENT_SIZE = 150 * 1024 * 1024;
|
||||
private static final String TAG = AttachmentDownloadJob.class.getSimpleName();
|
||||
|
||||
@Inject transient SignalServiceMessageReceiver messageReceiver;
|
||||
|
||||
@@ -112,7 +113,7 @@ public class AttachmentDownloadJob extends MasterSecretJob implements Injectable
|
||||
attachmentFile = createTempFile();
|
||||
|
||||
SignalServiceAttachmentPointer pointer = createAttachmentPointer(masterSecret, attachment);
|
||||
InputStream stream = messageReceiver.retrieveAttachment(pointer, attachmentFile, new ProgressListener() {
|
||||
InputStream stream = messageReceiver.retrieveAttachment(pointer, attachmentFile, MAX_ATTACHMENT_SIZE, new ProgressListener() {
|
||||
@Override
|
||||
public void onAttachmentProgress(long total, long progress) {
|
||||
EventBus.getDefault().postSticky(new PartProgressEvent(attachment, total, progress));
|
||||
|
@@ -30,6 +30,7 @@ import javax.inject.Inject;
|
||||
|
||||
public class AvatarDownloadJob extends MasterSecretJob implements InjectableType {
|
||||
|
||||
private static final int MAX_AVATAR_SIZE = 20 * 1024 * 1024;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static final String TAG = AvatarDownloadJob.class.getSimpleName();
|
||||
@@ -77,7 +78,7 @@ public class AvatarDownloadJob extends MasterSecretJob implements InjectableType
|
||||
attachment.deleteOnExit();
|
||||
|
||||
SignalServiceAttachmentPointer pointer = new SignalServiceAttachmentPointer(avatarId, contentType, key, relay, digest);
|
||||
InputStream inputStream = receiver.retrieveAttachment(pointer, attachment);
|
||||
InputStream inputStream = receiver.retrieveAttachment(pointer, attachment, MAX_AVATAR_SIZE);
|
||||
Bitmap avatar = BitmapUtil.createScaledBitmap(context, new AttachmentModel(attachment, key), 500, 500);
|
||||
|
||||
database.updateAvatar(groupId, avatar);
|
||||
|
Reference in New Issue
Block a user