File tree Expand file tree Collapse file tree 4 files changed +15
-11
lines changed Expand file tree Collapse file tree 4 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -3785,7 +3785,9 @@ async fn test_sync_broadcast() -> Result<()> {
3785
3785
assert_eq ! ( a1_broadcast_chat. get_name( ) , a0_broadcast_chat. get_name( ) ) ;
3786
3786
assert ! ( get_chat_contacts( alice1, a1_broadcast_id) . await ?. is_empty( ) ) ;
3787
3787
add_contact_to_chat ( alice0, a0_broadcast_id, a0b_contact_id) . await ?;
3788
- sync ( alice0, alice1) . await ;
3788
+ let sent = alice0. pop_sent_msg ( ) . await ;
3789
+ let rcvd = alice1. recv_msg ( & sent) . await ;
3790
+ dbg ! ( rcvd) ; // TODO
3789
3791
3790
3792
// This also imports Bob's key from the vCard.
3791
3793
// Otherwise it is possible that second device
Original file line number Diff line number Diff line change @@ -1404,7 +1404,6 @@ impl MimeFactory {
1404
1404
}
1405
1405
}
1406
1406
SystemMessage :: MemberAddedToGroup => {
1407
- ensure ! ( chat. typ != Chattype :: OutBroadcast ) ;
1408
1407
// TODO: lookup the contact by ID rather than email address.
1409
1408
// We are adding key-contacts, the cannot be looked up by address.
1410
1409
let email_to_add = msg. param . get ( Param :: Arg ) . unwrap_or_default ( ) ;
Original file line number Diff line number Diff line change @@ -3482,15 +3482,17 @@ async fn apply_out_broadcast_changes(
3482
3482
. await ?;
3483
3483
3484
3484
if let Some ( _removed_addr) = mime_parser. get_header ( HeaderDef :: ChatGroupMemberRemoved ) {
3485
- // The sender of the message left the broadcast channel
3486
- remove_from_chat_contacts_table ( context, chat. id , from_id) . await ?;
3487
-
3488
- return Ok ( GroupChangesInfo {
3489
- better_msg : Some ( "" . to_string ( ) ) ,
3490
- added_removed_id : None ,
3491
- silent : true ,
3492
- extra_msgs : vec ! [ ] ,
3493
- } ) ;
3485
+ if from_id != ContactId :: SELF {
3486
+ // The sender of the message left the broadcast channel
3487
+ remove_from_chat_contacts_table ( context, chat. id , from_id) . await ?;
3488
+
3489
+ return Ok ( GroupChangesInfo {
3490
+ better_msg : Some ( "" . to_string ( ) ) ,
3491
+ added_removed_id : None ,
3492
+ silent : true ,
3493
+ extra_msgs : vec ! [ ] ,
3494
+ } ) ;
3495
+ }
3494
3496
}
3495
3497
3496
3498
if send_event_chat_modified {
Original file line number Diff line number Diff line change @@ -306,6 +306,7 @@ pub(crate) fn create_id() -> String {
306
306
/// and is returned as 64 Base64 characters, each containing 6 bits of entropy.
307
307
/// 384 is chosen because it is sufficiently secure
308
308
/// (larger than AES-128 keys used for message encryption)
309
+ /// TODO: Is it still true that we use AES-128? This info is taken from create_id() comment above.
309
310
/// and divides both by 8 (byte size) and 6 (number of bits in a single Base64 character).
310
311
// TODO ask someone what a good size would be here
311
312
pub ( crate ) fn create_broadcast_shared_secret ( ) -> String {
You can’t perform that action at this time.
0 commit comments