Skip to content

Commit

Permalink
Abort story send if any of the messages do not have an attachment.
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-signal committed Jul 11, 2022
1 parent c906abd commit 5b781c4
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -197,8 +197,13 @@ public static void sendStories(@NonNull final Context context,
List<UploadDependencyGraph.Node> nodes = dependencyGraph.getDependencyMap().get(message);

if (nodes == null || nodes.isEmpty()) {
Log.d(TAG, "No attachments for given message. Skipping.");
continue;
if (message.getStoryType().isTextStory()) {
Log.d(TAG, "No attachments for given text story. Skipping.");
continue;
} else {
Log.e(TAG, "No attachments for given media story. Aborting.");
throw new MmsException("No attachment for story.");
}
}

List<AttachmentId> attachmentIds = nodes.stream().map(UploadDependencyGraph.Node::getAttachmentId).collect(Collectors.toList());
Expand Down

0 comments on commit 5b781c4

Please sign in to comment.