use of org.thoughtcrime.securesms.mms.MmsException in project Signal-Android by signalapp.
the class MmsSendJob method enqueue.
/**
* Enqueues compression jobs for attachments and finally the MMS send job.
*/
@WorkerThread
public static void enqueue(@NonNull Context context, @NonNull JobManager jobManager, long messageId) {
MessageDatabase database = SignalDatabase.mms();
OutgoingMediaMessage message;
try {
message = database.getOutgoingMessage(messageId);
} catch (MmsException | NoSuchMessageException e) {
throw new AssertionError(e);
}
List<Job> compressionJobs = Stream.of(message.getAttachments()).map(a -> (Job) AttachmentCompressionJob.fromAttachment((DatabaseAttachment) a, true, message.getSubscriptionId())).toList();
MmsSendJob sendJob = new MmsSendJob(messageId);
jobManager.startChain(compressionJobs).then(sendJob).enqueue();
}
Aggregations