Fixed registry JMAP helpers

This commit is contained in:
Maurus Decimus
2026-04-13 19:51:45 +02:00
parent 7564f51642
commit f3dfb7cb33
32 changed files with 487 additions and 282 deletions

View File

@@ -21,7 +21,7 @@ email = { path = "../email" }
registry = { path = "../registry" }
spam-filter = { path = "../spam-filter" }
trc = { path = "../trc" }
mail-auth = { path = "/Users/me/code/mail-auth", features = ["rkyv"] }
mail-auth = { version = "0.8", features = ["rkyv"] }
mail-parser = { version = "0.11", features = ["full_encoding"] }
mail-builder = { version = "0.4" }
smtp-proto = { version = "0.2", features = ["rkyv", "serde"] }

View File

@@ -803,4 +803,26 @@ impl ArchivedMessage {
next_delivery
}
pub fn next_notify_event(&self, queue: Option<QueueName>) -> Option<u64> {
let mut next_notify = None;
for rcpt in self.recipients.iter().filter(|d| {
matches!(
d.status,
ArchivedStatus::Scheduled | ArchivedStatus::TemporaryFailure(_)
) && queue.is_none_or(|q| d.queue == q)
}) {
let notify_due = rcpt.notify.due.to_native();
if let Some(next_notify) = &mut next_notify {
if notify_due < *next_notify {
*next_notify = notify_due;
}
} else {
next_notify = Some(notify_due);
}
}
next_notify
}
}