JMAP protocol layer refactoring (part 2)

This commit is contained in:
mdecimus
2025-09-24 18:14:44 +02:00
parent 6c612f7e1c
commit a95010c42e
60 changed files with 2260 additions and 1747 deletions

View File

@@ -9,7 +9,6 @@ use crate::core::Mailbox;
use ahash::AHashMap;
use common::{
auth::AccessToken,
config::jmap::settings::SpecialUse,
listener::{SessionStream, limiter::InFlight},
sharing::EffectiveAcl,
};
@@ -25,7 +24,7 @@ use std::{
sync::{Arc, atomic::Ordering},
};
use trc::AddContext;
use types::{acl::Acl, collection::Collection, id::Id, keyword::Keyword};
use types::{acl::Acl, collection::Collection, id::Id, keyword::Keyword, special_use::SpecialUse};
impl<T: SessionStream> SessionData<T> {
pub async fn new(

View File

@@ -9,9 +9,7 @@ use crate::{
op::ImapContext,
spawn_op,
};
use common::{
config::jmap::settings::SpecialUse, listener::SessionStream, storage::index::ObjectIndexBuilder,
};
use common::{listener::SessionStream, storage::index::ObjectIndexBuilder};
use directory::Permission;
use email::cache::{MessageCacheFetch, mailbox::MailboxCacheAccess};
use imap_proto::{
@@ -22,7 +20,7 @@ use imap_proto::{
use std::time::Instant;
use store::write::BatchBuilder;
use trc::AddContext;
use types::{acl::Acl, collection::Collection, id::Id};
use types::{acl::Acl, collection::Collection, id::Id, special_use::SpecialUse};
impl<T: SessionStream> Session<T> {
pub async fn handle_create(&mut self, requests: Vec<Request<Command>>) -> trc::Result<()> {

View File

@@ -22,7 +22,7 @@ use imap_proto::{
};
use mail_parser::HeaderName;
use nlp::language::Language;
use std::{sync::Arc, time::Instant};
use std::{str::FromStr, sync::Arc, time::Instant};
use store::{
SerializeInfallible,
fts::{Field, FilterGroup, FtsFilter, IntoFilterGroup},
@@ -650,7 +650,7 @@ impl<T: SessionStream> SessionData<T> {
include_highest_modseq = true;
}
search::Filter::EmailId(id) => {
if let Some(id) = Id::from_bytes(id.as_bytes()) {
if let Ok(id) = Id::from_str(&id) {
filters.push(query::Filter::is_in_set(
RoaringBitmap::from_sorted_iter([id.document_id()]).unwrap(),
));
@@ -661,7 +661,7 @@ impl<T: SessionStream> SessionData<T> {
}
}
search::Filter::ThreadId(id) => {
if let Some(id) = Id::from_bytes(id.as_bytes()) {
if let Ok(id) = Id::from_str(&id) {
filters.push(query::Filter::is_in_set(RoaringBitmap::from_iter(
cache.in_thread(id.document_id()).map(|m| m.document_id),
)));