Abort story send if any of the messages do not have an attachment.
This commit is contained in:
parent
c906abdb37
commit
5b781c45f3
1 changed files with 7 additions and 2 deletions
|
@ -197,8 +197,13 @@ public class MessageSender {
|
||||||
List<UploadDependencyGraph.Node> nodes = dependencyGraph.getDependencyMap().get(message);
|
List<UploadDependencyGraph.Node> nodes = dependencyGraph.getDependencyMap().get(message);
|
||||||
|
|
||||||
if (nodes == null || nodes.isEmpty()) {
|
if (nodes == null || nodes.isEmpty()) {
|
||||||
Log.d(TAG, "No attachments for given message. Skipping.");
|
if (message.getStoryType().isTextStory()) {
|
||||||
continue;
|
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());
|
List<AttachmentId> attachmentIds = nodes.stream().map(UploadDependencyGraph.Node::getAttachmentId).collect(Collectors.toList());
|
||||||
|
|
Loading…
Add table
Reference in a new issue