continue;
}
if (linkType == LinkType.POST) {
- if (line.length() >= (7 + 36)) {
- String postId = line.substring(7, 43);
- Optional<Post> post = postProvider.getPost(postId);
- if (post.isPresent()) {
- parts.add(new PostPart(post.get()));
- } else {
- parts.add(new PlainTextPart(line.substring(0, 43)));
- }
- line = line.substring(43);
+ Optional<Post> post = postProvider.getPost(link.substring(7));
+ if (post.isPresent()) {
+ parts.add(new PostPart(post.get()));
} else {
- parts.add(new PlainTextPart(line));
- line = "";
+ parts.add(new PlainTextPart(link));
}
+ line = line.substring(link.length());
continue;
}