Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
9694ba3
[WIP] QR codes and symmetric encryption for broadcast channels
Hocuri Oct 2, 2025
10091a7
Merge remote-tracking branch 'origin/main' into hoc/channels-encrypti…
Hocuri Oct 2, 2025
62d7441
test: Fix test_broadcast_multidev
Hocuri Oct 2, 2025
a434e6e
Fix some things, so that all tests pass sometimes. Some tests are sti…
Hocuri Oct 6, 2025
7f3d0cc
Merge remote-tracking branch 'origin/main' into hoc/channels-encrypti…
Hocuri Oct 6, 2025
17fdac2
clippy
Hocuri Oct 6, 2025
8b3b597
test: Fix the flaky tests. All tests pass now!
Hocuri Oct 6, 2025
915bad9
refactor: Remove unused MarkVerified sync action
Hocuri Oct 7, 2025
d755f61
improve comment
Hocuri Oct 7, 2025
e001067
Some things I noticed while self-reviewing
Hocuri Oct 7, 2025
c602586
Small comment improvements
Hocuri Oct 7, 2025
7d92fcd
fix: Don't invent a secret when receiving an outgoing broadcast message
Hocuri Oct 7, 2025
faa149a
small comment improvement
Hocuri Oct 8, 2025
5a91887
more comment improvements
Hocuri Oct 8, 2025
41b4953
more tweaks
Hocuri Oct 8, 2025
6114a6a
Merge remote-tracking branch 'origin/main' into hoc/channels-encrypti…
Hocuri Oct 8, 2025
27d1d35
small tweaks
Hocuri Oct 8, 2025
89f1e52
clippy
Hocuri Oct 8, 2025
7fcbf39
Simon's review
Hocuri Oct 15, 2025
e00db35
Merge branch 'main' into hoc/channels-encryption-3
Hocuri Oct 15, 2025
a3a932a
clippy
Hocuri Oct 15, 2025
7bd1ced
Update src/securejoin/bob.rs
Hocuri Oct 20, 2025
07a6062
Merge remote-tracking branch 'origin/main' into hoc/channels-encrypti…
Hocuri Oct 20, 2025
e6bb254
Update golden tests
Hocuri Oct 20, 2025
24cbcbe
fix: Don't add duplicate member-added message
Hocuri Oct 21, 2025
691887f
iequidoo's review
Hocuri Oct 21, 2025
e74f312
clippy
Hocuri Oct 21, 2025
fcc3363
Merge remote-tracking branch 'origin/main' into hoc/channels-encrypti…
Hocuri Oct 21, 2025
f336add
iequidoo's review
Hocuri Oct 23, 2025
24d5335
Fix compilation error
Hocuri Oct 23, 2025
a836775
Merge remote-tracking branch 'origin/main' into hoc/channels-encrypti…
Hocuri Oct 23, 2025
8a4044e
Another compilation error
Hocuri Oct 23, 2025
1d671d2
Fix test
Hocuri Oct 23, 2025
cafc2c7
Merge remote-tracking branch 'origin/main' into hoc/channels-encrypti…
Hocuri Oct 23, 2025
efc323f
fix: Show an error message when trying to send into an old channel
Hocuri Oct 23, 2025
ab1844d
Merge remote-tracking branch 'origin/main' into hoc/channels-encrypti…
Hocuri Oct 24, 2025
9776cd7
refactor: rename broadcast_shared_secret -> broadcast_secret
Hocuri Oct 25, 2025
745d38c
refactor: inline handle_sync_create_chat()
Hocuri Oct 25, 2025
1029707
Bail if added/removed member is missing
Hocuri Oct 25, 2025
205ca0f
refactor: Rename src/internals_for_benchmarks.rs -> src/internals_for…
Hocuri Oct 26, 2025
4d615d6
comments
Hocuri Oct 26, 2025
9f87a53
Make some code shorter
Hocuri Oct 26, 2025
c101f2a
Small changes from iequidoo's review
Hocuri Oct 26, 2025
93b8763
more of iequidoo's suggestions
Hocuri Oct 26, 2025
ea82fe9
Rename encryption_keys -> encryption_pubkeys
Hocuri Oct 26, 2025
0e0c534
clippy
Hocuri Oct 26, 2025
9e9ed67
Merge remote-tracking branch 'origin/main' into hoc/channels-encrypti…
Hocuri Oct 26, 2025
501b5a7
remaining review comments
Hocuri Oct 26, 2025
9e0ff87
more review
Hocuri Oct 28, 2025
717d6bb
review, again
Hocuri Oct 28, 2025
0a69a55
Make all rust tests pass again
Hocuri Oct 28, 2025
7fdee26
clippy
Hocuri Oct 28, 2025
1a85ad7
Update src/test_utils.rs
Hocuri Oct 28, 2025
05cacc0
small test improvements
Hocuri Oct 28, 2025
9048977
feat: Add and use stock string "You joined the channel"
Hocuri Oct 28, 2025
bd12139
Merge remote-tracking branch 'origin/main' into hoc/channels-encrypti…
Hocuri Oct 28, 2025
c3be22f
Update src/mimefactory.rs
Hocuri Oct 28, 2025
bc116bd
fix compilation
Hocuri Oct 28, 2025
d9e38c6
Try to fix Python tests
Hocuri Oct 28, 2025
c71f698
fix: Delete broadcast secret when leaving or being removed from channel
Hocuri Oct 28, 2025
dd3cffd
don't prematurely optimize SQL statement
Hocuri Oct 28, 2025
7be7ba0
feat: If someone who is not the admin tries to send into brodacast, a…
Hocuri Oct 29, 2025
1d3ae6d
small fixes
Hocuri Oct 29, 2025
327e0cc
test: Fix test flakiness
Hocuri Oct 29, 2025
af20e3e
fix: Delete request-with-auth messages immediately; some tests still …
Hocuri Oct 29, 2025
ca986cc
Update src/receive_imf.rs
Hocuri Oct 31, 2025
644d6e5
fix: stop using `leftgrps` table
link2xt Oct 28, 2025
1bbd3ec
feat(backwards-compat): For now, send Chat-Verified header (instead o…
Hocuri Oct 29, 2025
3723cd1
fix remaining test failures
Hocuri Oct 31, 2025
c1b53b1
Merge remote-tracking branch 'origin/main' into hoc/channels-encrypti…
Hocuri Oct 31, 2025
c0aa31c
fix: Set chat_created = true when creating outgoing broadcast
Hocuri Oct 31, 2025
2409431
Merge remote-tracking branch 'origin/main' into hoc/channels-encrypti…
Hocuri Nov 1, 2025
28d1ca9
fix: Use Chat-List-Id rather than List-Id header
Hocuri Nov 1, 2025
36a8f20
fix: Make sure broadcast members can't see each other
Hocuri Nov 3, 2025
8b300b8
fix: Use j= instead of i= in broadcast invites, so that old devices d…
Hocuri Nov 3, 2025
788765f
Fix compilation error
Hocuri Nov 3, 2025
47b8a2d
iequidoo's review
Hocuri Nov 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: stop using leftgrps table
  • Loading branch information
link2xt authored and Hocuri committed Oct 31, 2025
commit 644d6e579203a494010b21ad09c6f2b2929324d0
5 changes: 0 additions & 5 deletions deltachat-repl/src/cmdline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ async fn reset_tables(context: &Context, bits: i32) {
.await
.unwrap();
context.sql().config_cache().write().await.clear();
context
.sql()
.execute("DELETE FROM leftgrps;", ())
.await
.unwrap();
println!("(8) Rest but server config reset.");
}

Expand Down
20 changes: 0 additions & 20 deletions src/chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3980,7 +3980,6 @@ pub async fn remove_contact_from_chat(

if contact_id == ContactId::SELF {
res?;
set_group_explicitly_left(context, &chat.grpid).await?;
} else if let Err(e) = res {
warn!(
context,
Expand Down Expand Up @@ -4031,25 +4030,6 @@ async fn send_member_removal_msg(
send_msg(context, chat.id, &mut msg).await
}

async fn set_group_explicitly_left(context: &Context, grpid: &str) -> Result<()> {
if !is_group_explicitly_left(context, grpid).await? {
context
.sql
.execute("INSERT INTO leftgrps (grpid) VALUES(?);", (grpid,))
.await?;
}

Ok(())
}

pub(crate) async fn is_group_explicitly_left(context: &Context, grpid: &str) -> Result<bool> {
let exists = context
.sql
.exists("SELECT COUNT(*) FROM leftgrps WHERE grpid=?;", (grpid,))
.await?;
Ok(exists)
}

/// Sets group or mailing list chat name.
pub async fn set_chat_name(context: &Context, chat_id: ChatId, new_name: &str) -> Result<()> {
rename_ex(context, Sync, chat_id, new_name).await
Expand Down
44 changes: 44 additions & 0 deletions src/chat/chat_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5315,3 +5315,47 @@ async fn test_long_group_name() -> Result<()> {

Ok(())
}

/// Regression test for the case
/// when Bob leaves the group, joins back and deletes the chat.
/// Previously this resulted in the group
/// never appearing again without removing Bob
/// and readding back because the group was
/// recorded in `leftgrps` for Bob and everyone else
/// thought that Bob is part of the group.
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn test_leftgrps() -> Result<()> {
let mut tcm = TestContextManager::new();
let alice = &tcm.alice().await;
let bob = &tcm.bob().await;

// Alice creates a group with Bob and Bob accepts it.
let bob_id = alice.add_or_lookup_contact_id(bob).await;
let alice_chat_id = create_group(alice, "Group").await?;
add_contact_to_chat(alice, alice_chat_id, bob_id).await?;
let alice_sent = alice.send_text(alice_chat_id, "Hi!").await;
let bob_chat_id = bob.recv_msg(&alice_sent).await.chat_id;
bob_chat_id.accept(bob).await?;

// Bob leaves the group.
remove_contact_from_chat(bob, bob_chat_id, ContactId::SELF).await?;
let bob_sent = bob.pop_sent_msg().await;
alice.recv_msg(&bob_sent).await;

// Alice adds Bob back, Bob recognizes that the chat is the same.
add_contact_to_chat(alice, alice_chat_id, bob_id).await?;
let alice_sent = alice.pop_sent_msg().await;
let bob_chat_id2 = bob.recv_msg(&alice_sent).await.chat_id;
assert_eq!(bob_chat_id, bob_chat_id2);

// Bob deletes the chat.
bob_chat_id.delete(bob).await?;
let alice_sent = alice.send_text(alice_chat_id, "Hi again!").await;
let bob_chat_id3 = bob.recv_msg(&alice_sent).await.chat_id;

// Chat ID is new, but not a trash chat.
assert_ne!(bob_chat_id3, bob_chat_id);
assert!(!bob_chat_id3.is_special());

Ok(())
}
14 changes: 0 additions & 14 deletions src/receive_imf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2593,26 +2593,12 @@ async fn create_group(
let mut chat_id = None;
let mut chat_id_blocked = Default::default();

async fn self_explicitly_added(
context: &Context,
mime_parser: &&mut MimeMessage,
) -> Result<bool> {
let ret = match mime_parser.get_header(HeaderDef::ChatGroupMemberAdded) {
Some(member_addr) => context.is_self_addr(member_addr).await?,
None => false,
};
Ok(ret)
}

if chat_id.is_none()
&& !mime_parser.is_mailinglist_message()
&& !grpid.is_empty()
&& mime_parser.get_header(HeaderDef::ChatGroupName).is_some()
// otherwise, a pending "quit" message may pop up
&& mime_parser.get_header(HeaderDef::ChatGroupMemberRemoved).is_none()
// re-create explicitly left groups only if ourself is re-added
&& (!chat::is_group_explicitly_left(context, grpid).await?
|| self_explicitly_added(context, &mime_parser).await?)
{
// Group does not exist but should be created.
let grpname = mime_parser
Expand Down