aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2022-06-30 15:22:25 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2022-06-30 15:22:44 +0200
commit7efe08a9b8ef0af63cc80ab8fc67c5dabb726d26 (patch)
treec3046e3826335059f7ca385db413c2a64d389adf /src
parentb15026ec9ca2045f7ddb21a759cb075bb1dbd014 (diff)
downloadaerogramme-7efe08a9b8ef0af63cc80ab8fc67c5dabb726d26.tar.gz
aerogramme-7efe08a9b8ef0af63cc80ab8fc67c5dabb726d26.zip
Implement IMAP fetch internaldate
Diffstat (limited to 'src')
-rw-r--r--src/imap/mailbox_view.rs6
1 files changed, 5 insertions, 1 deletions
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))
+ ));
}
}
}