mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 19:06:35 +03:00
refactor: use mail-builder instead of lettre_email
This commit is contained in:
12
src/sync.rs
12
src/sync.rs
@@ -1,7 +1,7 @@
|
||||
//! # Synchronize items between devices.
|
||||
|
||||
use anyhow::Result;
|
||||
use lettre_email::PartBuilder;
|
||||
use mail_builder::mime::MimePart;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::chat::{self, ChatId};
|
||||
@@ -227,14 +227,8 @@ impl Context {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn build_sync_part(&self, json: String) -> PartBuilder {
|
||||
PartBuilder::new()
|
||||
.content_type(&"application/json".parse::<mime::Mime>().unwrap())
|
||||
.header((
|
||||
"Content-Disposition",
|
||||
"attachment; filename=\"multi-device-sync.json\"",
|
||||
))
|
||||
.body(json)
|
||||
pub(crate) fn build_sync_part(&self, json: String) -> MimePart<'static> {
|
||||
MimePart::new("application/json", json).attachment("multi-device-sync.json")
|
||||
}
|
||||
|
||||
/// Takes a JSON string created by `build_sync_json()`
|
||||
|
||||
Reference in New Issue
Block a user