Fixed registry JMAP helpers
This commit is contained in:
@@ -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"] }
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user