Skip to content

Commit 9dd8426

Browse files
committed
cleanup
1 parent 35dc5d9 commit 9dd8426

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/message.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1818,9 +1818,9 @@ pub async fn delete_msgs_ex(
18181818

18191819
if !deleted_info_msgs.is_empty() {
18201820
if modified_chat_ids.len() > 1 {
1821-
bail!("Can delete only from same chat.");
1821+
bail!("Can only delete from same chat.");
18221822
}
1823-
let (info_msg_ids, info_msg_rfc724): (Vec<MsgId>, Vec<_>) =
1823+
let (info_msg_ids, info_msg_rfc724): (Vec<_>, Vec<_>) =
18241824
deleted_info_msgs.into_iter().unzip();
18251825

18261826
for &msg_id in &info_msg_ids {
@@ -1829,7 +1829,7 @@ pub async fn delete_msgs_ex(
18291829
}
18301830

18311831
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?;
18331833
}
18341834
}
18351835

@@ -1839,7 +1839,7 @@ pub async fn delete_msgs_ex(
18391839
"Can delete only from same chat."
18401840
);
18411841
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?;
18431843
}
18441844
} else {
18451845
context
@@ -1863,16 +1863,15 @@ pub async fn delete_msgs_ex(
18631863

18641864
async fn send_delete_request(
18651865
context: &Context,
1866-
deleted_rfc724_mid: &[String],
18671866
chat_id: &ChatId,
1868-
) -> Result<(), anyhow::Error> {
1867+
deleted_rfc724_mid: &[String],
1868+
) -> Result<MsgId> {
18691869
let mut msg = Message::new_text("🚮".to_owned());
18701870
msg.param.set_int(Param::GuaranteeE2ee, 1);
18711871
msg.param
18721872
.set(Param::DeleteRequestFor, deleted_rfc724_mid.join(" "));
18731873
msg.hidden = true;
1874-
send_msg(context, *chat_id, &mut msg).await?;
1875-
Ok(())
1874+
send_msg(context, *chat_id, &mut msg).await
18761875
}
18771876

18781877
/// Marks requested messages as seen.

0 commit comments

Comments
 (0)