kopia lustrzana https://github.com/ryukoposting/Signal-Android
Check if there is an attachment available before trying to send it to a story.
rodzic
f6f4e6fde7
commit
a7a4972013
|
@ -177,8 +177,10 @@ public final class PushDistributionListSendJob extends PushSendJob {
|
|||
final SignalServiceStoryMessage storyMessage;
|
||||
if (message.getStoryType().isTextStory()) {
|
||||
storyMessage = SignalServiceStoryMessage.forTextAttachment(Recipient.self().getProfileKey(), null, StorySendUtil.deserializeBodyToStoryTextAttachment(message, this::getPreviewsFor), message.getStoryType().isStoryWithReplies());
|
||||
} else {
|
||||
} else if (!attachmentPointers.isEmpty()) {
|
||||
storyMessage = SignalServiceStoryMessage.forFileAttachment(Recipient.self().getProfileKey(), null, attachmentPointers.get(0), message.getStoryType().isStoryWithReplies());
|
||||
} else {
|
||||
throw new UndeliverableMessageException("No attachment on non-text story.");
|
||||
}
|
||||
return GroupSendUtil.sendStoryMessage(context, message.getRecipient().requireDistributionListId(), destinations, isRecipientUpdate, new MessageId(messageId, true), message.getSentTimeMillis(), storyMessage);
|
||||
} catch (ServerRejectedException e) {
|
||||
|
|
|
@ -253,8 +253,10 @@ public final class PushGroupSendJob extends PushSendJob {
|
|||
final SignalServiceStoryMessage storyMessage;
|
||||
if (message.getStoryType().isTextStory()) {
|
||||
storyMessage = SignalServiceStoryMessage.forTextAttachment(Recipient.self().getProfileKey(), groupContext, StorySendUtil.deserializeBodyToStoryTextAttachment(message, this::getPreviewsFor), message.getStoryType().isStoryWithReplies());
|
||||
} else {
|
||||
} else if (!attachmentPointers.isEmpty()) {
|
||||
storyMessage = SignalServiceStoryMessage.forFileAttachment(Recipient.self().getProfileKey(), groupContext, attachmentPointers.get(0), message.getStoryType().isStoryWithReplies());
|
||||
} else {
|
||||
throw new UndeliverableMessageException("No attachment on non-text story.");
|
||||
}
|
||||
|
||||
return GroupSendUtil.sendGroupStoryMessage(context, groupId.requireV2(), destinations, isRecipientUpdate, new MessageId(messageId, true), message.getSentTimeMillis(), storyMessage);
|
||||
|
|
Ładowanie…
Reference in New Issue