diff --git a/src/chat.rs b/src/chat.rs index 7023b03adf..786c27b4ff 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -1768,16 +1768,6 @@ impl Chat { .remove(Param::Unpromoted) .set_i64(Param::GroupNameTimestamp, msg.timestamp_sort); self.update_param(context).await?; - // TODO: Remove this compat code needed because Core <= v1.143: - // - doesn't accept synchronization of QR code tokens for unpromoted groups, so we also - // send them when the group is promoted. - // - doesn't sync QR code tokens for unpromoted groups and the group might be created - // before an upgrade. - context - .sync_qr_code_tokens(Some(self.grpid.as_str())) - .await - .log_err(context) - .ok(); } let is_bot = context.get_config_bool(Config::Bot).await?; @@ -3879,18 +3869,12 @@ pub(crate) async fn add_contact_to_chat_ex( ); return Ok(false); } - - let sync_qr_code_tokens; if from_handshake && chat.param.get_int(Param::Unpromoted).unwrap_or_default() == 1 { chat.param .remove(Param::Unpromoted) .set_i64(Param::GroupNameTimestamp, smeared_time(context)); chat.update_param(context).await?; - sync_qr_code_tokens = true; - } else { - sync_qr_code_tokens = false; } - if context.is_self_addr(contact.get_addr()).await? { // ourself is added using ContactId::SELF, do not add this address explicitly. // if SELF is not in the group, members cannot be added at all. @@ -3939,20 +3923,6 @@ pub(crate) async fn add_contact_to_chat_ex( send_msg(context, chat_id, &mut msg).await?; sync = Nosync; - // TODO: Remove this compat code needed because Core <= v1.143: - // - doesn't accept synchronization of QR code tokens for unpromoted groups, so we also send - // them when the group is promoted. - // - doesn't sync QR code tokens for unpromoted groups and the group might be created before - // an upgrade. - if sync_qr_code_tokens - && context - .sync_qr_code_tokens(Some(chat.grpid.as_str())) - .await - .log_err(context) - .is_ok() - { - context.scheduler.interrupt_smtp().await; - } } context.emit_event(EventType::ChatModified(chat_id)); if sync.into() { diff --git a/src/sync.rs b/src/sync.rs index 5eb403d102..b0dc32c755 100644 --- a/src/sync.rs +++ b/src/sync.rs @@ -789,19 +789,7 @@ mod tests { let bob = &tcm.bob().await; tcm.exec_securejoin_qr(bob, alice, &qr).await; - let msg_id = alice.send_sync_msg().await?; - // Core <= v1.143 doesn't sync QR code tokens immediately, so current Core does that when a - // group is promoted for compatibility (because the group could be created by older Core). - // TODO: assert!(msg_id.is_none()); - assert!(msg_id.is_some()); - let sent = alice.pop_sent_msg().await; - let msg = alice.parse_msg(&sent).await; - let mut sync_items = msg.sync_items.unwrap().items; - assert_eq!(sync_items.len(), 1); - let data = sync_items.pop().unwrap().data; - let SyncDataOrUnknown::SyncData(AddQrToken(_)) = data else { - unreachable!(); - }; + assert!(alice.send_sync_msg().await?.is_none()); // Remove Bob because alice2 doesn't have their key. let alice_bob_id = alice.add_or_lookup_contact(bob).await.id;