Correct failed recipient

This commit is contained in:
Hocuri
2020-06-09 19:28:49 +02:00
parent 2e59d5674e
commit bd2a7a3d40
4 changed files with 63 additions and 46 deletions

View File

@@ -2441,23 +2441,22 @@ mod tests {
assert_eq!(msg.state, MessageState::OutFailed);
let msgs = chat::get_chat_msgs(&t.ctx, msg.chat_id, 0, None).await;
let mut found = false;
for id in msgs.iter() {
let m = Message::load_from_db(&t.ctx, *id).await.unwrap();
if m.from_id == DC_CONTACT_ID_INFO
&& m.text
== Some(
t.ctx
.stock_string_repl_str(
StockMessage::FailedSendingTo,
"assidhfaaspocwaeofi@gmail.com",
)
.await,
println!("Loading {}", msg.chat_id);
let last_msg = Message::load_from_db(&t.ctx, *msgs.last().unwrap())
.await
.unwrap();
assert_eq!(last_msg.from_id, DC_CONTACT_ID_INFO);
assert_eq!(
last_msg.text,
Some(
t.ctx
.stock_string_repl_str(
StockMessage::FailedSendingTo,
"assidhfaaspocwaeofi@gmail.com",
)
{
found = true;
}
}
assert!(found);
.await,
)
);
}
}