Fix SMIL regression

Closes #2654

// FREEBIE
This commit is contained in:
Jake McGinty
2015-03-12 13:39:19 -07:00
committed by Moxie Marlinspike
parent 761ccf4b3f
commit 073d019103
9 changed files with 97 additions and 111 deletions

View File

@@ -22,6 +22,7 @@ import org.thoughtcrime.securesms.transport.UndeliverableMessageException;
import org.thoughtcrime.securesms.util.Hex;
import org.thoughtcrime.securesms.util.NumberUtil;
import org.thoughtcrime.securesms.util.TelephonyUtil;
import org.thoughtcrime.securesms.util.SmilUtil;
import org.whispersystems.jobqueue.JobParameters;
import org.whispersystems.jobqueue.requirements.NetworkRequirement;
@@ -98,6 +99,7 @@ public class MmsSendJob extends SendJob {
MmsRadio radio = MmsRadio.getInstance(context);
try {
prepareMessageMedia(masterSecret, message, MediaConstraints.MMS_CONSTRAINTS, true);
if (isCdmaDevice()) {
Log.w(TAG, "Sending MMS directly without radio change...");
try {
@@ -129,9 +131,9 @@ public class MmsSendJob extends SendJob {
radio.disconnect();
}
} catch (MmsRadioException mre) {
Log.w(TAG, mre);
throw new UndeliverableMessageException(mre);
} catch (MmsRadioException | IOException e) {
Log.w(TAG, e);
throw new UndeliverableMessageException(e);
}
}
@@ -141,8 +143,6 @@ public class MmsSendJob extends SendJob {
{
String number = TelephonyUtil.getManager(context).getLine1Number();
prepareMessageMedia(masterSecret, message, MediaConstraints.MMS_CONSTRAINTS, true);
if (MmsDatabase.Types.isSecureType(message.getDatabaseMessageBox())) {
throw new UndeliverableMessageException("Attempt to send encrypted MMS?");
}
@@ -227,6 +227,12 @@ public class MmsSendJob extends SendJob {
}
}
@Override
protected void prepareMessageMedia(MasterSecret masterSecret, SendReq message,
MediaConstraints constraints, boolean toMemory)
throws IOException, UndeliverableMessageException {
super.prepareMessageMedia(masterSecret, message, constraints, toMemory);
message.setBody(SmilUtil.getSmilBody(message.getBody()));
}
}