From 7efe08a9b8ef0af63cc80ab8fc67c5dabb726d26 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Thu, 30 Jun 2022 15:22:25 +0200 Subject: Implement IMAP fetch internaldate --- src/imap/mailbox_view.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/imap') diff --git a/src/imap/mailbox_view.rs b/src/imap/mailbox_view.rs index 0feb588..7707aaf 100644 --- a/src/imap/mailbox_view.rs +++ b/src/imap/mailbox_view.rs @@ -4,8 +4,10 @@ use std::sync::Arc; use anyhow::{anyhow, bail, Error, Result}; use boitalettres::proto::res::body::Data as Body; +use chrono::{Offset, Utc, TimeZone}; use futures::stream::{FuturesOrdered, StreamExt}; use imap_codec::types::address::Address; +use imap_codec::types::datetime::MyDateTime; use imap_codec::types::core::{Atom, IString, NString, NonZeroBytes}; use imap_codec::types::envelope::Envelope; use imap_codec::types::fetch_attributes::{FetchAttribute, MacroOrFetchAttributes}; @@ -288,7 +290,9 @@ impl MailboxView { todo!() } FetchAttribute::InternalDate => { - todo!() + attributes.push(MessageAttribute::InternalDate( + MyDateTime(Utc.fix().timestamp(i64::try_from(meta.internaldate / 1000)?, 0)) + )); } } } -- cgit v1.2.3