mirror of
https://github.com/chatmail/core.git
synced 2026-05-16 21:36:30 +03:00
Fix CI
This commit is contained in:
@@ -647,6 +647,15 @@ def test_verified_group_vs_delete_server_after(acfactory, tmp_path, lp):
|
|||||||
chat2.send_text("hi2")
|
chat2.send_text("hi2")
|
||||||
|
|
||||||
lp.sec("ac2_offl: receiving message")
|
lp.sec("ac2_offl: receiving message")
|
||||||
|
ev = ac2_offl._evtracker.get_matching("DC_EVENT_INCOMING_MSG|DC_EVENT_MSGS_CHANGED")
|
||||||
|
msg_in = ac2_offl.get_message_by_id(ev.data2)
|
||||||
|
assert msg_in.is_system_message()
|
||||||
|
assert msg_in.text == "Messages are guaranteed to be end-to-end encrypted from now on."
|
||||||
|
|
||||||
|
# We need to consume one event that has data2=0
|
||||||
|
ev = ac2_offl._evtracker.get_matching("DC_EVENT_INCOMING_MSG|DC_EVENT_MSGS_CHANGED")
|
||||||
|
assert ev.data2 == 0
|
||||||
|
|
||||||
ev = ac2_offl._evtracker.get_matching("DC_EVENT_INCOMING_MSG|DC_EVENT_MSGS_CHANGED")
|
ev = ac2_offl._evtracker.get_matching("DC_EVENT_INCOMING_MSG|DC_EVENT_MSGS_CHANGED")
|
||||||
msg_in = ac2_offl.get_message_by_id(ev.data2)
|
msg_in = ac2_offl.get_message_by_id(ev.data2)
|
||||||
assert not msg_in.is_system_message()
|
assert not msg_in.is_system_message()
|
||||||
|
|||||||
@@ -606,14 +606,11 @@ pub(crate) async fn observe_securejoin_on_other_device(
|
|||||||
return Ok(HandshakeMessage::Ignore);
|
return Ok(HandshakeMessage::Ignore);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if !peerstate.is_using_verified_key() {
|
|
||||||
// The `if` is purely for performance:
|
|
||||||
// If the verified key was used already, then the 1:1 chat was already protected.
|
|
||||||
ChatId::set_protection_for_contact(context, contact_id).await?;
|
|
||||||
}
|
|
||||||
peerstate.set_verified(PeerstateKeyType::GossipKey, fingerprint, addr)?;
|
peerstate.set_verified(PeerstateKeyType::GossipKey, fingerprint, addr)?;
|
||||||
peerstate.prefer_encrypt = EncryptPreference::Mutual;
|
peerstate.prefer_encrypt = EncryptPreference::Mutual;
|
||||||
peerstate.save_to_db(&context.sql).await.unwrap_or_default();
|
peerstate.save_to_db(&context.sql).await.unwrap_or_default();
|
||||||
|
|
||||||
|
ChatId::set_protection_for_contact(context, contact_id).await?;
|
||||||
} else if let Some(fingerprint) =
|
} else if let Some(fingerprint) =
|
||||||
mime_message.get_header(HeaderDef::SecureJoinFingerprint)
|
mime_message.get_header(HeaderDef::SecureJoinFingerprint)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ async fn test_create_verified_oneonone_chat() -> Result<()> {
|
|||||||
let chat = alice.create_chat(&fiona).await;
|
let chat = alice.create_chat(&fiona).await;
|
||||||
assert!(chat.is_protected());
|
assert!(chat.is_protected());
|
||||||
|
|
||||||
let msg = alice.get_last_msg().await;
|
let msg = alice.get_last_msg_in(chat.id).await;
|
||||||
let expected_text = stock_str::chat_protection_enabled(&alice).await;
|
let expected_text = stock_str::chat_protection_enabled(&alice).await;
|
||||||
assert_eq!(msg.text, expected_text);
|
assert_eq!(msg.text, expected_text);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user