mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-21 02:08:40 +00:00
Keep caption when forwarding media with a body to a story.
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user