mirror of
https://github.com/chatmail/core.git
synced 2026-10-02 11:10:25 +03:00
test: exec_securejoin_qr_multi_device(): Make inviter devices receive each other messages
Otherwise we're testing an abnormal scenario when `Config::BccSelf` ("multi-device") is disabled.
This commit is contained in:
@@ -272,6 +272,7 @@ impl TestContextManager {
|
|||||||
|
|
||||||
/// Executes SecureJoin initiated by `joiner`
|
/// Executes SecureJoin initiated by `joiner`
|
||||||
/// scanning `qr` generated by one of the `inviters` devices.
|
/// scanning `qr` generated by one of the `inviters` devices.
|
||||||
|
/// `inviters` devices must have the same primary address.
|
||||||
/// All of the `inviters` devices will get the messages and send replies.
|
/// All of the `inviters` devices will get the messages and send replies.
|
||||||
///
|
///
|
||||||
/// The [`ChatId`] of the created chat is returned, for a SetupContact QR this is the 1:1
|
/// The [`ChatId`] of the created chat is returned, for a SetupContact QR this is the 1:1
|
||||||
@@ -283,8 +284,10 @@ impl TestContextManager {
|
|||||||
qr: &str,
|
qr: &str,
|
||||||
) -> ChatId {
|
) -> ChatId {
|
||||||
assert!(joiner.pop_sent_msg_opt(Duration::ZERO).await.is_none());
|
assert!(joiner.pop_sent_msg_opt(Duration::ZERO).await.is_none());
|
||||||
|
let inviter_addr = inviters[0].get_primary_self_addr().await.unwrap();
|
||||||
for inviter in inviters {
|
for inviter in inviters {
|
||||||
assert!(inviter.pop_sent_msg_opt(Duration::ZERO).await.is_none());
|
assert!(inviter.pop_sent_msg_opt(Duration::ZERO).await.is_none());
|
||||||
|
assert_eq!(inviter.get_primary_self_addr().await.unwrap(), inviter_addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
let chat_id = join_securejoin(&joiner.ctx, qr).await.unwrap();
|
let chat_id = join_securejoin(&joiner.ctx, qr).await.unwrap();
|
||||||
@@ -300,6 +303,14 @@ impl TestContextManager {
|
|||||||
}
|
}
|
||||||
for inviter in inviters {
|
for inviter in inviters {
|
||||||
if let Some(sent) = inviter.pop_sent_msg_ex(rev_order, Duration::ZERO).await {
|
if let Some(sent) = inviter.pop_sent_msg_ex(rev_order, Duration::ZERO).await {
|
||||||
|
if sent.recipients.split(' ').any(|addr| addr == inviter_addr) {
|
||||||
|
for observer in inviters {
|
||||||
|
// `imap::prefetch_should_download()` returns false on the sender side.
|
||||||
|
if observer.get_id() != inviter.get_id() {
|
||||||
|
observer.recv_msg_opt(&sent).await;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
joiner.recv_msg_opt(&sent).await;
|
joiner.recv_msg_opt(&sent).await;
|
||||||
something_sent = true;
|
something_sent = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,6 @@ OutBroadcast#Chat#1001: Channel [0 member(s)]
|
|||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
Msg#1001: info (Contact#Contact#Info): Messages are end-to-end encrypted. [NOTICED][INFO]
|
Msg#1001: info (Contact#Contact#Info): Messages are end-to-end encrypted. [NOTICED][INFO]
|
||||||
Msg#1006🔒: Me (Contact#Contact#Self): Member bob@example.net added. [INFO] √
|
Msg#1006🔒: Me (Contact#Contact#Self): Member bob@example.net added. [INFO] √
|
||||||
Msg#1008🔒: Me (Contact#Contact#Self): hi √
|
Msg#1009🔒: Me (Contact#Contact#Self): hi √
|
||||||
Msg#1009🔒: Me (Contact#Contact#Self): You removed member bob@example.net. [INFO] √
|
Msg#1010🔒: Me (Contact#Contact#Self): You removed member bob@example.net. [INFO] √
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -2,6 +2,6 @@ OutBroadcast#Chat#1001: Channel [0 member(s)]
|
|||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
Msg#1002: info (Contact#Contact#Info): Messages are end-to-end encrypted. [NOTICED][INFO]
|
Msg#1002: info (Contact#Contact#Info): Messages are end-to-end encrypted. [NOTICED][INFO]
|
||||||
Msg#1006🔒: Me (Contact#Contact#Self): Member bob@example.net added. [INFO] √
|
Msg#1006🔒: Me (Contact#Contact#Self): Member bob@example.net added. [INFO] √
|
||||||
Msg#1008🔒: Me (Contact#Contact#Self): hi √
|
Msg#1009🔒: Me (Contact#Contact#Self): hi √
|
||||||
Msg#1009🔒: Me (Contact#Contact#Self): You removed member bob@example.net. [INFO] √
|
Msg#1010🔒: Me (Contact#Contact#Self): You removed member bob@example.net. [INFO] √
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user