From 170b428d36f1128ff7768fbfb294ab0c38b03989 Mon Sep 17 00:00:00 2001 From: rustmailer Date: Thu, 30 Oct 2025 21:33:29 +0800 Subject: [PATCH] refactor: Remove `attachment` field from EmailAddedToFolder --- src/modules/hook/events/payload.rs | 45 ++++++++++++++---------------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/src/modules/hook/events/payload.rs b/src/modules/hook/events/payload.rs index 8c1fe9d..afca52e 100644 --- a/src/modules/hook/events/payload.rs +++ b/src/modules/hook/events/payload.rs @@ -5,7 +5,6 @@ use crate::modules::{ bounce::parser::{DeliveryStatus, FeedbackReport, RawEmailHeaders}, common::Addr, - imap::section::ImapAttachment, message::content::FullMessageContent, }; use serde::{Deserialize, Serialize}; @@ -55,8 +54,6 @@ pub struct EmailAddedToFolder { pub reply_to: Option>, /// Optional list of recipient addresses (To field) for the email. pub to: Option>, - /// Optional list of attachments included in the email. - pub attachments: Option>, /// A list of labels applied to the message. /// /// Each element is a string representing a Gmail label ID (e.g., "INBOX", "UNREAD"). @@ -66,28 +63,28 @@ pub struct EmailAddedToFolder { pub labels: Vec, } -#[derive(Clone, Serialize, Deserialize, Debug)] -pub struct Attachment { - /// Optional filename of the attachment, as specified in the email. - pub filename: Option, - /// Indicates whether the attachment is inline (e.g., embedded in the email body) or not. - pub inline: bool, - /// Size of the attachment in bytes. - pub size: usize, - /// MIME type of the attachment (e.g., "application/pdf", "image/jpeg"). - pub file_type: String, -} +// #[derive(Clone, Serialize, Deserialize, Debug)] +// pub struct Attachment { +// /// Optional filename of the attachment, as specified in the email. +// pub filename: Option, +// /// Indicates whether the attachment is inline (e.g., embedded in the email body) or not. +// pub inline: bool, +// /// Size of the attachment in bytes. +// pub size: usize, +// /// MIME type of the attachment (e.g., "application/pdf", "image/jpeg"). +// pub file_type: String, +// } -impl From for Attachment { - fn from(value: ImapAttachment) -> Self { - Self { - filename: value.filename, - inline: value.inline, - size: value.size, - file_type: value.file_type, - } - } -} +// impl From for Attachment { +// fn from(value: ImapAttachment) -> Self { +// Self { +// filename: value.filename, +// inline: value.inline, +// size: value.size, +// file_type: value.file_type, +// } +// } +// } #[derive(Clone, Serialize, Deserialize, Debug)] pub struct EmailFlagsChanged {