mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 17:36:29 +03:00
More multidevice fixes; it's still not working completely
This commit is contained in:
@@ -3785,7 +3785,9 @@ async fn test_sync_broadcast() -> Result<()> {
|
|||||||
assert_eq!(a1_broadcast_chat.get_name(), a0_broadcast_chat.get_name());
|
assert_eq!(a1_broadcast_chat.get_name(), a0_broadcast_chat.get_name());
|
||||||
assert!(get_chat_contacts(alice1, a1_broadcast_id).await?.is_empty());
|
assert!(get_chat_contacts(alice1, a1_broadcast_id).await?.is_empty());
|
||||||
add_contact_to_chat(alice0, a0_broadcast_id, a0b_contact_id).await?;
|
add_contact_to_chat(alice0, a0_broadcast_id, a0b_contact_id).await?;
|
||||||
sync(alice0, alice1).await;
|
let sent = alice0.pop_sent_msg().await;
|
||||||
|
let rcvd = alice1.recv_msg(&sent).await;
|
||||||
|
dbg!(rcvd); // TODO
|
||||||
|
|
||||||
// This also imports Bob's key from the vCard.
|
// This also imports Bob's key from the vCard.
|
||||||
// Otherwise it is possible that second device
|
// Otherwise it is possible that second device
|
||||||
|
|||||||
@@ -1404,7 +1404,6 @@ impl MimeFactory {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
SystemMessage::MemberAddedToGroup => {
|
SystemMessage::MemberAddedToGroup => {
|
||||||
ensure!(chat.typ != Chattype::OutBroadcast);
|
|
||||||
// TODO: lookup the contact by ID rather than email address.
|
// TODO: lookup the contact by ID rather than email address.
|
||||||
// We are adding key-contacts, the cannot be looked up by address.
|
// We are adding key-contacts, the cannot be looked up by address.
|
||||||
let email_to_add = msg.param.get(Param::Arg).unwrap_or_default();
|
let email_to_add = msg.param.get(Param::Arg).unwrap_or_default();
|
||||||
|
|||||||
@@ -3482,15 +3482,17 @@ async fn apply_out_broadcast_changes(
|
|||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
if let Some(_removed_addr) = mime_parser.get_header(HeaderDef::ChatGroupMemberRemoved) {
|
if let Some(_removed_addr) = mime_parser.get_header(HeaderDef::ChatGroupMemberRemoved) {
|
||||||
// The sender of the message left the broadcast channel
|
if from_id != ContactId::SELF {
|
||||||
remove_from_chat_contacts_table(context, chat.id, from_id).await?;
|
// The sender of the message left the broadcast channel
|
||||||
|
remove_from_chat_contacts_table(context, chat.id, from_id).await?;
|
||||||
|
|
||||||
return Ok(GroupChangesInfo {
|
return Ok(GroupChangesInfo {
|
||||||
better_msg: Some("".to_string()),
|
better_msg: Some("".to_string()),
|
||||||
added_removed_id: None,
|
added_removed_id: None,
|
||||||
silent: true,
|
silent: true,
|
||||||
extra_msgs: vec![],
|
extra_msgs: vec![],
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if send_event_chat_modified {
|
if send_event_chat_modified {
|
||||||
|
|||||||
@@ -306,6 +306,7 @@ pub(crate) fn create_id() -> String {
|
|||||||
/// and is returned as 64 Base64 characters, each containing 6 bits of entropy.
|
/// and is returned as 64 Base64 characters, each containing 6 bits of entropy.
|
||||||
/// 384 is chosen because it is sufficiently secure
|
/// 384 is chosen because it is sufficiently secure
|
||||||
/// (larger than AES-128 keys used for message encryption)
|
/// (larger than AES-128 keys used for message encryption)
|
||||||
|
/// TODO: Is it still true that we use AES-128? This info is taken from create_id() comment above.
|
||||||
/// and divides both by 8 (byte size) and 6 (number of bits in a single Base64 character).
|
/// and divides both by 8 (byte size) and 6 (number of bits in a single Base64 character).
|
||||||
// TODO ask someone what a good size would be here
|
// TODO ask someone what a good size would be here
|
||||||
pub(crate) fn create_broadcast_shared_secret() -> String {
|
pub(crate) fn create_broadcast_shared_secret() -> String {
|
||||||
|
|||||||
Reference in New Issue
Block a user