mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
fixes
This commit is contained in:
28
src/chat.rs
28
src/chat.rs
@@ -4660,6 +4660,7 @@ mod tests {
|
|||||||
use crate::headerdef::HeaderDef;
|
use crate::headerdef::HeaderDef;
|
||||||
use crate::message::delete_msgs;
|
use crate::message::delete_msgs;
|
||||||
use crate::receive_imf::receive_imf;
|
use crate::receive_imf::receive_imf;
|
||||||
|
use crate::securejoin::{get_securejoin_qr, join_securejoin};
|
||||||
use crate::test_utils::{sync, TestContext, TestContextManager, TimeShiftFalsePositiveNote};
|
use crate::test_utils::{sync, TestContext, TestContextManager, TimeShiftFalsePositiveNote};
|
||||||
use strum::IntoEnumIterator;
|
use strum::IntoEnumIterator;
|
||||||
use tokio::fs;
|
use tokio::fs;
|
||||||
@@ -7728,7 +7729,7 @@ mod tests {
|
|||||||
let group_editor = tcm.fiona().await;
|
let group_editor = tcm.fiona().await;
|
||||||
|
|
||||||
// alice creates verified group with group editor bot
|
// alice creates verified group with group editor bot
|
||||||
tcm.execute_securejoin(&alice, &bob).await;
|
tcm.execute_securejoin(&alice, &group_editor).await;
|
||||||
let alice_chat_id = alice
|
let alice_chat_id = alice
|
||||||
.create_group_with_members(
|
.create_group_with_members(
|
||||||
ProtectionStatus::Protected,
|
ProtectionStatus::Protected,
|
||||||
@@ -7741,15 +7742,30 @@ mod tests {
|
|||||||
|
|
||||||
// group editor bot sends a message
|
// group editor bot sends a message
|
||||||
let group_editor_chat_id = recv.chat_id;
|
let group_editor_chat_id = recv.chat_id;
|
||||||
|
group_editor_chat_id.accept(&group_editor).await?;
|
||||||
let webxdc = group_editor
|
let webxdc = group_editor
|
||||||
.send_text(group_editor_chat_id, "<Webxdc>")
|
.send_text(group_editor_chat_id, "<Webxdc>")
|
||||||
.await;
|
.await;
|
||||||
alice.recv_msg(&webxdc).await;
|
alice.recv_msg(&webxdc).await;
|
||||||
|
|
||||||
// Alice adds bob
|
tcm.section("bob scans alice' QR code");
|
||||||
let bob_contact = alice.add_or_lookup_contact_id(&bob).await;
|
let join_qr = get_securejoin_qr(&alice, Some(alice_chat_id)).await?;
|
||||||
add_contact_to_chat(&alice, alice_chat_id, bob_contact).await?;
|
join_securejoin(&bob, &join_qr).await.unwrap();
|
||||||
let msg = alice.pop_sent_msg().await;
|
loop {
|
||||||
|
if let Some(sent) = bob.pop_sent_msg_opt(Duration::ZERO).await {
|
||||||
|
alice.recv_msg_opt(&sent).await;
|
||||||
|
} else if let Some(sent) = alice.pop_sent_msg_opt(Duration::ZERO).await {
|
||||||
|
bob.recv_msg_opt(&sent).await;
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let chatlist = Chatlist::try_load(&bob, 0, None, None).await?;
|
||||||
|
println!(
|
||||||
|
"{:?}",
|
||||||
|
get_chat_contacts(&bob, chatlist.iter().last().unwrap().0).await?
|
||||||
|
);
|
||||||
|
|
||||||
// group editor bot resends webxdc
|
// group editor bot resends webxdc
|
||||||
group_editor.recv_msg(&msg).await;
|
group_editor.recv_msg(&msg).await;
|
||||||
@@ -7760,8 +7776,6 @@ mod tests {
|
|||||||
bob.recv_msg(&resent).await;
|
bob.recv_msg(&resent).await;
|
||||||
bob.recv_msg(&msg).await;
|
bob.recv_msg(&msg).await;
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user