Improved object serialization
This commit is contained in:
@@ -7,13 +7,10 @@
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use common::listener::SessionStream;
|
||||
use email::mailbox::{MailboxFnc, UidMailbox, INBOX_ID};
|
||||
use jmap_proto::{
|
||||
object::Object,
|
||||
types::{collection::Collection, property::Property, value::Value},
|
||||
};
|
||||
use email::mailbox::{INBOX_ID, UidMailbox, manage::MailboxFnc};
|
||||
use jmap_proto::types::{collection::Collection, property::Property};
|
||||
use store::{
|
||||
ahash::AHashMap, write::key::DeserializeBigEndian, IndexKey, IterateParams, Serialize, U32_LEN,
|
||||
IndexKey, IterateParams, Serialize, U32_LEN, ahash::AHashMap, write::key::DeserializeBigEndian,
|
||||
};
|
||||
use trc::AddContext;
|
||||
|
||||
@@ -64,7 +61,7 @@ impl<T: SessionStream> Session<T> {
|
||||
.caused_by(trc::location!())?;
|
||||
let uid_validity = self
|
||||
.server
|
||||
.get_property::<Object<Value>>(
|
||||
.get_property::<email::mailbox::Mailbox>(
|
||||
account_id,
|
||||
Collection::Mailbox,
|
||||
INBOX_ID,
|
||||
@@ -72,15 +69,14 @@ impl<T: SessionStream> Session<T> {
|
||||
)
|
||||
.await
|
||||
.caused_by(trc::location!())?
|
||||
.and_then(|obj| obj.get(&Property::Cid).as_uint())
|
||||
.ok_or_else(|| {
|
||||
trc::StoreEvent::UnexpectedError
|
||||
.caused_by(trc::location!())
|
||||
.details("Failed to obtain UID validity")
|
||||
.account_id(account_id)
|
||||
.document_id(INBOX_ID)
|
||||
})
|
||||
.map(|v| v as u32)?;
|
||||
})?
|
||||
.uid_validity;
|
||||
|
||||
// Obtain message sizes
|
||||
self.server
|
||||
|
||||
@@ -8,12 +8,12 @@ use std::time::Instant;
|
||||
|
||||
use common::listener::SessionStream;
|
||||
use directory::Permission;
|
||||
use jmap::email::delete::EmailDeletion;
|
||||
use email::message::delete::EmailDeletion;
|
||||
use jmap_proto::types::{state::StateChange, type_state::DataType};
|
||||
use store::roaring::RoaringBitmap;
|
||||
use trc::AddContext;
|
||||
|
||||
use crate::{protocol::response::Response, Session, State};
|
||||
use crate::{Session, State, protocol::response::Response};
|
||||
|
||||
impl<T: SessionStream> Session<T> {
|
||||
pub async fn handle_dele(&mut self, msgs: Vec<u32>) -> trc::Result<()> {
|
||||
|
||||
@@ -8,13 +8,13 @@ use std::time::Instant;
|
||||
|
||||
use common::listener::SessionStream;
|
||||
use directory::Permission;
|
||||
use email::metadata::MessageMetadata;
|
||||
use email::message::metadata::MessageMetadata;
|
||||
use jmap::blob::download::BlobDownload;
|
||||
use jmap_proto::types::{collection::Collection, property::Property};
|
||||
use store::write::Bincode;
|
||||
use trc::AddContext;
|
||||
|
||||
use crate::{protocol::response::Response, Session};
|
||||
use crate::{Session, protocol::response::Response};
|
||||
|
||||
impl<T: SessionStream> Session<T> {
|
||||
pub async fn handle_fetch(&mut self, msg: u32, lines: Option<u32>) -> trc::Result<()> {
|
||||
|
||||
Reference in New Issue
Block a user