mirror of
https://git.meli.delivery/meli/meli
synced 2024-11-17 03:26:20 +00:00
melib: add Envelope::recipient_any method
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
This commit is contained in:
parent
735b44f286
commit
1abce964c7
@ -859,6 +859,16 @@ impl Envelope {
|
||||
pub fn tags_mut(&mut self) -> &mut IndexSet<TagHash> {
|
||||
&mut self.tags
|
||||
}
|
||||
|
||||
/// Returns `true` if `is_recipient` address is included in To:, Cc: or Bcc:
|
||||
/// headers.
|
||||
pub fn recipient_any(&self, is_recipient: &Address) -> bool {
|
||||
self.to()
|
||||
.iter()
|
||||
.chain(self.cc().iter())
|
||||
.chain(self.bcc().iter())
|
||||
.any(|a| a == is_recipient)
|
||||
}
|
||||
}
|
||||
|
||||
impl Eq for Envelope {}
|
||||
|
Loading…
Reference in New Issue
Block a user