@@ -1818,9 +1818,9 @@ pub async fn delete_msgs_ex(
1818
1818
1819
1819
if !deleted_info_msgs. is_empty ( ) {
1820
1820
if modified_chat_ids. len ( ) > 1 {
1821
- bail ! ( "Can delete only from same chat." ) ;
1821
+ bail ! ( "Can only delete from same chat." ) ;
1822
1822
}
1823
- let ( info_msg_ids, info_msg_rfc724) : ( Vec < MsgId > , Vec < _ > ) =
1823
+ let ( info_msg_ids, info_msg_rfc724) : ( Vec < _ > , Vec < _ > ) =
1824
1824
deleted_info_msgs. into_iter ( ) . unzip ( ) ;
1825
1825
1826
1826
for & msg_id in & info_msg_ids {
@@ -1829,7 +1829,7 @@ pub async fn delete_msgs_ex(
1829
1829
}
1830
1830
1831
1831
if let Some ( chat_id) = modified_chat_ids. iter ( ) . next ( ) {
1832
- send_delete_request ( context, & info_msg_rfc724 , chat_id ) . await ?;
1832
+ send_delete_request ( context, chat_id , & info_msg_rfc724 ) . await ?;
1833
1833
}
1834
1834
}
1835
1835
@@ -1839,7 +1839,7 @@ pub async fn delete_msgs_ex(
1839
1839
"Can delete only from same chat."
1840
1840
) ;
1841
1841
if let Some ( chat_id) = modified_chat_ids. iter ( ) . next ( ) {
1842
- send_delete_request ( context, & deleted_rfc724_mid , chat_id ) . await ?;
1842
+ send_delete_request ( context, chat_id , & deleted_rfc724_mid ) . await ?;
1843
1843
}
1844
1844
} else {
1845
1845
context
@@ -1863,16 +1863,15 @@ pub async fn delete_msgs_ex(
1863
1863
1864
1864
async fn send_delete_request (
1865
1865
context : & Context ,
1866
- deleted_rfc724_mid : & [ String ] ,
1867
1866
chat_id : & ChatId ,
1868
- ) -> Result < ( ) , anyhow:: Error > {
1867
+ deleted_rfc724_mid : & [ String ] ,
1868
+ ) -> Result < MsgId > {
1869
1869
let mut msg = Message :: new_text ( "🚮" . to_owned ( ) ) ;
1870
1870
msg. param . set_int ( Param :: GuaranteeE2ee , 1 ) ;
1871
1871
msg. param
1872
1872
. set ( Param :: DeleteRequestFor , deleted_rfc724_mid. join ( " " ) ) ;
1873
1873
msg. hidden = true ;
1874
- send_msg ( context, * chat_id, & mut msg) . await ?;
1875
- Ok ( ( ) )
1874
+ send_msg ( context, * chat_id, & mut msg) . await
1876
1875
}
1877
1876
1878
1877
/// Marks requested messages as seen.
0 commit comments