@@ -1369,7 +1369,7 @@ impl MimeFactory {
1369
1369
1370
1370
// add attachment part
1371
1371
if msg. viewtype . has_file ( ) {
1372
- let ( file_part, _ ) = build_body_file ( context, & msg, "" ) . await ?;
1372
+ let file_part = build_body_file ( context, & msg) . await ?;
1373
1373
parts. push ( file_part) ;
1374
1374
}
1375
1375
@@ -1509,11 +1509,7 @@ pub(crate) fn wrapped_base64_encode(buf: &[u8]) -> String {
1509
1509
. join ( "\r \n " )
1510
1510
}
1511
1511
1512
- async fn build_body_file (
1513
- context : & Context ,
1514
- msg : & Message ,
1515
- base_name : & str ,
1516
- ) -> Result < ( PartBuilder , String ) > {
1512
+ async fn build_body_file ( context : & Context , msg : & Message ) -> Result < PartBuilder > {
1517
1513
let blob = msg
1518
1514
. param
1519
1515
. get_blob ( Param :: File , context)
@@ -1539,17 +1535,13 @@ async fn build_body_file(
1539
1535
) ,
1540
1536
Viewtype :: Image | Viewtype :: Gif => format ! (
1541
1537
"image_{}.{}" ,
1542
- if base_name. is_empty( ) {
1543
- chrono:: Utc
1544
- . timestamp_opt( msg. timestamp_sort, 0 )
1545
- . single( )
1546
- . map_or_else(
1547
- || "YY-mm-dd_hh:mm:ss" . to_string( ) ,
1548
- |ts| ts. format( "%Y-%m-%d_%H-%M-%S" ) . to_string( ) ,
1549
- )
1550
- } else {
1551
- base_name. to_string( )
1552
- } ,
1538
+ chrono:: Utc
1539
+ . timestamp_opt( msg. timestamp_sort, 0 )
1540
+ . single( )
1541
+ . map_or_else(
1542
+ || "YY-mm-dd_hh:mm:ss" . to_string( ) ,
1543
+ |ts| ts. format( "%Y-%m-%d_%H-%M-%S" ) . to_string( ) ,
1544
+ ) ,
1553
1545
& suffix,
1554
1546
) ,
1555
1547
Viewtype :: Video => format ! (
@@ -1601,7 +1593,7 @@ async fn build_body_file(
1601
1593
. header ( ( "Content-Transfer-Encoding" , "base64" ) )
1602
1594
. body ( encoded_body) ;
1603
1595
1604
- Ok ( ( mail, filename_to_send ) )
1596
+ Ok ( mail)
1605
1597
}
1606
1598
1607
1599
async fn build_avatar_file ( context : & Context , path : & str ) -> Result < String > {
0 commit comments