aboutsummaryrefslogtreecommitdiff
path: root/src/mail
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2023-11-15 15:56:43 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2023-11-15 15:56:43 +0100
commit916b27d87ec7f5bff41f9dd888914d50ae067fc0 (patch)
tree68b94498bf0fed5b7abf6d4b7e4d1f2ddbbb80f4 /src/mail
parent652da6efd35f198289ba3de26b60eb2e228de73a (diff)
downloadaerogramme-916b27d87ec7f5bff41f9dd888914d50ae067fc0.tar.gz
aerogramme-916b27d87ec7f5bff41f9dd888914d50ae067fc0.zip
WIP refactor storage (new timestamp.rs file)
Diffstat (limited to 'src/mail')
-rw-r--r--src/mail/incoming.rs3
-rw-r--r--src/mail/mailbox.rs4
-rw-r--r--src/mail/unique_ident.rs2
-rw-r--r--src/mail/user.rs3
4 files changed, 5 insertions, 7 deletions
diff --git a/src/mail/incoming.rs b/src/mail/incoming.rs
index e550e98..c3a9390 100644
--- a/src/mail/incoming.rs
+++ b/src/mail/incoming.rs
@@ -15,7 +15,6 @@ use tokio::sync::watch;
use tracing::{error, info, warn};
use crate::cryptoblob;
-use crate::k2v_util::k2v_wait_value_changed;
use crate::login::{Credentials, PublicCredentials};
use crate::mail::mailbox::Mailbox;
use crate::mail::uidindex::ImapUidvalidity;
@@ -23,7 +22,7 @@ use crate::mail::unique_ident::*;
use crate::mail::user::User;
use crate::mail::IMF;
use crate::storage;
-use crate::time::now_msec;
+use crate::timestamp::now_msec;
const INCOMING_PK: &str = "incoming";
const INCOMING_LOCK_SK: &str = "lock";
diff --git a/src/mail/mailbox.rs b/src/mail/mailbox.rs
index e8111df..f27d50a 100644
--- a/src/mail/mailbox.rs
+++ b/src/mail/mailbox.rs
@@ -9,7 +9,7 @@ use crate::mail::uidindex::*;
use crate::mail::unique_ident::*;
use crate::mail::IMF;
use crate::storage::{RowStore, BlobStore, self};
-use crate::time::now_msec;
+use crate::timestamp::now_msec;
pub struct Mailbox {
pub(super) id: UniqueIdent,
@@ -227,7 +227,7 @@ impl MailboxInternal {
if let Some(meta) = meta_opt {
meta_vec.push(meta);
} else {
- bail!("No valid meta value in k2v for {:?}", res.to_ref().sk());
+ bail!("No valid meta value in k2v for {:?}", res.to_ref().key());
}
}
diff --git a/src/mail/unique_ident.rs b/src/mail/unique_ident.rs
index 267f66e..0e629db 100644
--- a/src/mail/unique_ident.rs
+++ b/src/mail/unique_ident.rs
@@ -5,7 +5,7 @@ use lazy_static::lazy_static;
use rand::prelude::*;
use serde::{de::Error, Deserialize, Deserializer, Serialize, Serializer};
-use crate::time::now_msec;
+use crate::timestamp::now_msec;
/// An internal Mail Identifier is composed of two components:
/// - a process identifier, 128 bits, itself composed of:
diff --git a/src/mail/user.rs b/src/mail/user.rs
index 3b8d4e7..6d3bc1a 100644
--- a/src/mail/user.rs
+++ b/src/mail/user.rs
@@ -2,7 +2,6 @@ use std::collections::{BTreeMap, HashMap};
use std::sync::{Arc, Weak};
use anyhow::{anyhow, bail, Result};
-use k2v_client::{CausalityToken, K2vClient, K2vValue};
use lazy_static::lazy_static;
use serde::{Deserialize, Serialize};
use tokio::sync::watch;
@@ -14,7 +13,7 @@ use crate::mail::mailbox::Mailbox;
use crate::mail::uidindex::ImapUidvalidity;
use crate::mail::unique_ident::{gen_ident, UniqueIdent};
use crate::storage;
-use crate::time::now_msec;
+use crate::timestamp::now_msec;
pub const MAILBOX_HIERARCHY_DELIMITER: char = '.';