mirror of
https://github.com/chatmail/core.git
synced 2026-05-09 01:46:30 +03:00
Do not show error messages in chat
This commit is contained in:
@@ -405,6 +405,17 @@ async fn add_parts(
|
|||||||
.await
|
.await
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
|
|
||||||
|
if chat_id.is_unset() {
|
||||||
|
// check if the message belongs to a mailing list
|
||||||
|
if mime_parser.failed_msg.is_some() {
|
||||||
|
*chat_id = ChatId::new(DC_CHAT_ID_TRASH);
|
||||||
|
info!(
|
||||||
|
context,
|
||||||
|
"Message belongs to an NDN list and is not shown in a chat.",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// get the chat_id - a chat_id here is no indicator that the chat is displayed in the normal list,
|
// get the chat_id - a chat_id here is no indicator that the chat is displayed in the normal list,
|
||||||
// it might also be blocked and displayed in the deaddrop as a result
|
// it might also be blocked and displayed in the deaddrop as a result
|
||||||
if chat_id.is_unset() {
|
if chat_id.is_unset() {
|
||||||
@@ -2327,7 +2338,6 @@ mod tests {
|
|||||||
|
|
||||||
#[async_std::test]
|
#[async_std::test]
|
||||||
async fn test_parse_ndn() {
|
async fn test_parse_ndn() {
|
||||||
use std::io::Write;
|
|
||||||
use std::{thread, time};
|
use std::{thread, time};
|
||||||
|
|
||||||
let t = dummy_context().await;
|
let t = dummy_context().await;
|
||||||
@@ -2374,8 +2384,6 @@ mod tests {
|
|||||||
|
|
||||||
println!("Loading msg {}…", msg_id);
|
println!("Loading msg {}…", msg_id);
|
||||||
let msg = Message::load_from_db(&t.ctx, msg_id).await.unwrap();
|
let msg = Message::load_from_db(&t.ctx, msg_id).await.unwrap();
|
||||||
std::io::stdout().flush().unwrap();
|
|
||||||
thread::sleep(time::Duration::from_millis(1000));
|
|
||||||
|
|
||||||
assert_eq!(msg.state, MessageState::OutFailed);
|
assert_eq!(msg.state, MessageState::OutFailed);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
|
|||||||
Reference in New Issue
Block a user