mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-24 15:31:46 +00:00
Update attachment content type when updating attachment data
Fixes #4687 Closes #4688
This commit is contained in:
committed by
Moxie Marlinspike
parent
afb21203b7
commit
8269047c88
@@ -10,7 +10,9 @@ import org.thoughtcrime.securesms.crypto.MasterSecret;
|
||||
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
||||
import org.thoughtcrime.securesms.database.AttachmentDatabase;
|
||||
import org.thoughtcrime.securesms.mms.MediaConstraints;
|
||||
import org.thoughtcrime.securesms.mms.MediaStream;
|
||||
import org.thoughtcrime.securesms.transport.UndeliverableMessageException;
|
||||
import org.thoughtcrime.securesms.util.MediaUtil;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
import org.whispersystems.jobqueue.JobParameters;
|
||||
|
||||
@@ -19,6 +21,7 @@ import java.io.InputStream;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import ws.com.google.android.mms.ContentType;
|
||||
import ws.com.google.android.mms.MmsException;
|
||||
|
||||
public abstract class SendJob extends MasterSecretJob {
|
||||
@@ -63,7 +66,7 @@ public abstract class SendJob extends MasterSecretJob {
|
||||
if (constraints.isSatisfied(context, masterSecret, attachment)) {
|
||||
results.add(attachment);
|
||||
} else if (constraints.canResize(attachment)) {
|
||||
InputStream resized = constraints.getResizedMedia(context, masterSecret, attachment);
|
||||
MediaStream resized = constraints.getResizedMedia(context, masterSecret, attachment);
|
||||
results.add(attachmentDatabase.updateAttachmentData(masterSecret, attachment, resized));
|
||||
} else {
|
||||
throw new UndeliverableMessageException("Size constraints could not be met!");
|
||||
|
||||
Reference in New Issue
Block a user