diff --git a/app/src/main/java/org/thoughtcrime/securesms/jobs/PushDistributionListSendJob.java b/app/src/main/java/org/thoughtcrime/securesms/jobs/PushDistributionListSendJob.java index 4eca00129b2cf90591f42224c468c35fe234163e..c8fb50b612d299ba626dff86f347c0e8ddd28144 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/jobs/PushDistributionListSendJob.java +++ b/app/src/main/java/org/thoughtcrime/securesms/jobs/PushDistributionListSendJob.java @@ -9,6 +9,7 @@ import com.annimon.stream.Stream; import org.signal.core.util.logging.Log; import org.thoughtcrime.securesms.attachments.Attachment; +import org.thoughtcrime.securesms.attachments.DatabaseAttachment; import org.thoughtcrime.securesms.database.GroupReceiptDatabase; import org.thoughtcrime.securesms.database.MessageDatabase; import org.thoughtcrime.securesms.database.NoSuchMessageException; @@ -99,6 +100,11 @@ public final class PushDistributionListSendJob extends PushSendJob { throw new AssertionError("Only story messages are currently supported! MessageId: " + messageId); } + if (!message.getStoryType().isTextStory()) { + DatabaseAttachment storyAttachment = (DatabaseAttachment) message.getAttachments().get(0); + SignalDatabase.attachments().updateAttachmentCaption(storyAttachment.getAttachmentId(), message.getBody()); + } + Set<String> attachmentUploadIds = enqueueCompressingAndUploadAttachmentsChains(jobManager, message); jobManager.add(new PushDistributionListSendJob(messageId, destination, !attachmentUploadIds.isEmpty(), filterRecipientIds), attachmentUploadIds, attachmentUploadIds.isEmpty() ? null : destination.toQueueKey()); diff --git a/app/src/main/java/org/thoughtcrime/securesms/sharing/MultiShareSender.java b/app/src/main/java/org/thoughtcrime/securesms/sharing/MultiShareSender.java index 24d4c6b677e57be3c005776ee4346c48c1b1e1ec..078845d35519a1af3bfb8b7ed02b92a3f07b4178 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/sharing/MultiShareSender.java +++ b/app/src/main/java/org/thoughtcrime/securesms/sharing/MultiShareSender.java @@ -41,6 +41,7 @@ import org.thoughtcrime.securesms.sms.OutgoingEncryptedMessage; import org.thoughtcrime.securesms.sms.OutgoingTextMessage; import org.thoughtcrime.securesms.stories.Stories; import org.thoughtcrime.securesms.util.Base64; +import org.thoughtcrime.securesms.util.MediaUtil; import org.thoughtcrime.securesms.util.MessageUtil; import org.thoughtcrime.securesms.util.Util; @@ -220,7 +221,12 @@ public final class MultiShareSender { } else if (canSendAsTextStory) { outgoingMessages.add(generateTextStory(recipient, multiShareArgs, sentTimestamp, storyType)); } else { - for (final Slide slide : slideDeck.getSlides()) { + List<Slide> storySupportedSlides = slideDeck.getSlides() + .stream() + .filter(it -> MediaUtil.isStorySupportedType(it.getContentType())) + .collect(Collectors.toList()); + + for (final Slide slide : storySupportedSlides) { SlideDeck singletonDeck = new SlideDeck(); singletonDeck.addSlide(slide);