aboutsummaryrefslogtreecommitdiff
path: root/aero-collections/src/mail
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2024-05-16 17:38:34 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2024-05-16 17:38:34 +0200
commit32dfd25f570b7a55bf43752684d286be0f6b2dc2 (patch)
treedd77871cda851bb5795743a3f04be61cf4c3ad61 /aero-collections/src/mail
parent6b9542088cd1b66af46e95b787493b601accb495 (diff)
downloadaerogramme-32dfd25f570b7a55bf43752684d286be0f6b2dc2.tar.gz
aerogramme-32dfd25f570b7a55bf43752684d286be0f6b2dc2.zip
format + WIP calendar-query
Diffstat (limited to 'aero-collections/src/mail')
-rw-r--r--aero-collections/src/mail/incoming.rs4
-rw-r--r--aero-collections/src/mail/mailbox.rs6
-rw-r--r--aero-collections/src/mail/mod.rs2
-rw-r--r--aero-collections/src/mail/namespace.rs6
-rw-r--r--aero-collections/src/mail/snapshot.rs2
-rw-r--r--aero-collections/src/mail/uidindex.rs2
6 files changed, 13 insertions, 9 deletions
diff --git a/aero-collections/src/mail/incoming.rs b/aero-collections/src/mail/incoming.rs
index cd2f8fd..55c2515 100644
--- a/aero-collections/src/mail/incoming.rs
+++ b/aero-collections/src/mail/incoming.rs
@@ -8,16 +8,16 @@ use futures::{future::BoxFuture, FutureExt};
use tokio::sync::watch;
use tracing::{debug, error, info, warn};
+use aero_bayou::timestamp::now_msec;
use aero_user::cryptoblob;
use aero_user::login::{Credentials, PublicCredentials};
use aero_user::storage;
-use aero_bayou::timestamp::now_msec;
use crate::mail::mailbox::Mailbox;
use crate::mail::uidindex::ImapUidvalidity;
+use crate::mail::IMF;
use crate::unique_ident::*;
use crate::user::User;
-use crate::mail::IMF;
const INCOMING_PK: &str = "incoming";
const INCOMING_LOCK_SK: &str = "lock";
diff --git a/aero-collections/src/mail/mailbox.rs b/aero-collections/src/mail/mailbox.rs
index fcdb21e..bec9669 100644
--- a/aero-collections/src/mail/mailbox.rs
+++ b/aero-collections/src/mail/mailbox.rs
@@ -2,15 +2,15 @@ use anyhow::{anyhow, bail, Result};
use serde::{Deserialize, Serialize};
use tokio::sync::RwLock;
+use aero_bayou::timestamp::now_msec;
+use aero_bayou::Bayou;
use aero_user::cryptoblob::{self, gen_key, open_deserialize, seal_serialize, Key};
use aero_user::login::Credentials;
use aero_user::storage::{self, BlobRef, BlobVal, RowRef, RowVal, Selector, Store};
-use aero_bayou::Bayou;
-use aero_bayou::timestamp::now_msec;
-use crate::unique_ident::*;
use crate::mail::uidindex::*;
use crate::mail::IMF;
+use crate::unique_ident::*;
pub struct Mailbox {
pub(super) id: UniqueIdent,
diff --git a/aero-collections/src/mail/mod.rs b/aero-collections/src/mail/mod.rs
index ca9b08b..584a9eb 100644
--- a/aero-collections/src/mail/mod.rs
+++ b/aero-collections/src/mail/mod.rs
@@ -1,9 +1,9 @@
pub mod incoming;
pub mod mailbox;
+pub mod namespace;
pub mod query;
pub mod snapshot;
pub mod uidindex;
-pub mod namespace;
// Internet Message Format
// aka RFC 822 - RFC 2822 - RFC 5322
diff --git a/aero-collections/src/mail/namespace.rs b/aero-collections/src/mail/namespace.rs
index b1f6a70..0f1db7d 100644
--- a/aero-collections/src/mail/namespace.rs
+++ b/aero-collections/src/mail/namespace.rs
@@ -104,7 +104,11 @@ impl MailboxList {
/// Ensures mailbox `name` maps to id `id`.
/// If it already mapped to that, returns None.
/// If a change had to be done, returns Some(new uidvalidity in mailbox).
- pub(crate) fn set_mailbox(&mut self, name: &str, id: Option<UniqueIdent>) -> Option<ImapUidvalidity> {
+ pub(crate) fn set_mailbox(
+ &mut self,
+ name: &str,
+ id: Option<UniqueIdent>,
+ ) -> Option<ImapUidvalidity> {
let (ts, id, uidvalidity) = match self.0.get_mut(name) {
None => {
if id.is_none() {
diff --git a/aero-collections/src/mail/snapshot.rs b/aero-collections/src/mail/snapshot.rs
index 9503d4d..6f8a8a8 100644
--- a/aero-collections/src/mail/snapshot.rs
+++ b/aero-collections/src/mail/snapshot.rs
@@ -2,10 +2,10 @@ use std::sync::Arc;
use anyhow::Result;
-use crate::unique_ident::UniqueIdent;
use super::mailbox::Mailbox;
use super::query::{Query, QueryScope};
use super::uidindex::UidIndex;
+use crate::unique_ident::UniqueIdent;
/// A Frozen Mailbox has a snapshot of the current mailbox
/// state that is desynchronized with the real mailbox state.
diff --git a/aero-collections/src/mail/uidindex.rs b/aero-collections/src/mail/uidindex.rs
index ca975a3..6df3206 100644
--- a/aero-collections/src/mail/uidindex.rs
+++ b/aero-collections/src/mail/uidindex.rs
@@ -3,8 +3,8 @@ use std::num::{NonZeroU32, NonZeroU64};
use im::{HashMap, OrdMap, OrdSet};
use serde::{Deserialize, Deserializer, Serialize, Serializer};
-use aero_bayou::*;
use crate::unique_ident::UniqueIdent;
+use aero_bayou::*;
pub type ModSeq = NonZeroU64;
pub type ImapUid = NonZeroU32;