Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

843: Mails are not forwarded to a closed PR any more #1103

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -83,8 +83,7 @@ private static String decodeFromStrings(String body) {

private static final Pattern inReplyToPattern = Pattern.compile("<(.*@.*?)>");

public static List<Conversation> parseMbox(String mbox, EmailAddress sender) {
var emails = splitMbox(mbox, sender);
public static List<Conversation> parseMbox(List<Email> emails) {
var idToMail = emails.stream().collect(Collectors.toMap(Email::id, Function.identity(), (a, b) -> a));
var idToConversation = idToMail.values().stream()
.filter(email -> !email.hasHeader("In-Reply-To"))
@@ -150,7 +150,7 @@ public List<Conversation> conversations(Duration maxAge) {
}

if (newContent) {
var conversations = Mbox.parseConversations(emails);
var conversations = Mbox.parseMbox(emails);
var threshold = ZonedDateTime.now().minus(maxAge);
cachedConversations = conversations.stream()
.filter(mail -> mail.first().date().isAfter(threshold))
@@ -59,7 +59,7 @@ public List<Conversation> conversations(Duration maxAge) {
return new LinkedList<>();
}
var cutoff = Instant.now().minus(maxAge);
return Mbox.parseConversations(emails).stream()
return Mbox.parseMbox(emails).stream()
.filter(email -> email.first().date().toInstant().isAfter(cutoff))
.collect(Collectors.toList());
}