mirror of
https://github.com/chatmail/core.git
synced 2026-04-23 00:16:34 +03:00
feat: Don't add "Failed to send message to ..." info messages to group chats
A NDN may arrive days after the message is sent when it's already impossible to tell which message wasn't delivered looking at the "Failed to send" info message, so it only clutters the chat and makes the user think they tried to send some message recently which isn't true. Moreover, the info message duplicates the info already displayed in the error message behind the exclamation mark and info messages do not point to the message that is failed to be sent. Moreover it works rarely because `mimeparser.rs` only parses recipients from `x-failed-recipients`, so it likely only works for Gmail. Postfix does not add this `X-Failed-Recipients` header. Let's remove this parsing too. Thanks to @link2xt for pointing this out.
This commit is contained in:
@@ -868,18 +868,10 @@ async fn test_parse_ndn_group_msg() -> Result<()> {
|
||||
assert_eq!(msg.state, MessageState::OutFailed);
|
||||
|
||||
let msgs = chat::get_chat_msgs(&t, msg.chat_id).await?;
|
||||
let msg_id = if let ChatItem::Message { msg_id } = msgs.last().unwrap() {
|
||||
msg_id
|
||||
} else {
|
||||
let ChatItem::Message { msg_id } = *msgs.last().unwrap() else {
|
||||
panic!("Wrong item type");
|
||||
};
|
||||
let last_msg = Message::load_from_db(&t, *msg_id).await?;
|
||||
|
||||
assert_eq!(
|
||||
last_msg.text,
|
||||
stock_str::failed_sending_to(&t, "assidhfaaspocwaeofi@gmail.com").await
|
||||
);
|
||||
assert_eq!(last_msg.from_id, ContactId::INFO);
|
||||
assert_eq!(msg_id, msg.id);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user