kopia lustrzana https://github.com/ryukoposting/Signal-Android
Keep caption when forwarding media with a body to a story.
rodzic
f038e81ff3
commit
442dde5c40
|
@ -9,6 +9,7 @@ import com.annimon.stream.Stream;
|
||||||
|
|
||||||
import org.signal.core.util.logging.Log;
|
import org.signal.core.util.logging.Log;
|
||||||
import org.thoughtcrime.securesms.attachments.Attachment;
|
import org.thoughtcrime.securesms.attachments.Attachment;
|
||||||
|
import org.thoughtcrime.securesms.attachments.DatabaseAttachment;
|
||||||
import org.thoughtcrime.securesms.database.GroupReceiptDatabase;
|
import org.thoughtcrime.securesms.database.GroupReceiptDatabase;
|
||||||
import org.thoughtcrime.securesms.database.MessageDatabase;
|
import org.thoughtcrime.securesms.database.MessageDatabase;
|
||||||
import org.thoughtcrime.securesms.database.NoSuchMessageException;
|
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);
|
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);
|
Set<String> attachmentUploadIds = enqueueCompressingAndUploadAttachmentsChains(jobManager, message);
|
||||||
|
|
||||||
jobManager.add(new PushDistributionListSendJob(messageId, destination, !attachmentUploadIds.isEmpty(), filterRecipientIds), attachmentUploadIds, attachmentUploadIds.isEmpty() ? null : destination.toQueueKey());
|
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.sms.OutgoingTextMessage;
|
||||||
import org.thoughtcrime.securesms.stories.Stories;
|
import org.thoughtcrime.securesms.stories.Stories;
|
||||||
import org.thoughtcrime.securesms.util.Base64;
|
import org.thoughtcrime.securesms.util.Base64;
|
||||||
|
import org.thoughtcrime.securesms.util.MediaUtil;
|
||||||
import org.thoughtcrime.securesms.util.MessageUtil;
|
import org.thoughtcrime.securesms.util.MessageUtil;
|
||||||
import org.thoughtcrime.securesms.util.Util;
|
import org.thoughtcrime.securesms.util.Util;
|
||||||
|
|
||||||
|
@ -220,7 +221,12 @@ public final class MultiShareSender {
|
||||||
} else if (canSendAsTextStory) {
|
} else if (canSendAsTextStory) {
|
||||||
outgoingMessages.add(generateTextStory(recipient, multiShareArgs, sentTimestamp, storyType));
|
outgoingMessages.add(generateTextStory(recipient, multiShareArgs, sentTimestamp, storyType));
|
||||||
} else {
|
} 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();
|
SlideDeck singletonDeck = new SlideDeck();
|
||||||
singletonDeck.addSlide(slide);
|
singletonDeck.addSlide(slide);
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue