Commit Graph

5189 Commits

Author SHA1 Message Date
Hocuri
fc52c8de05 Merge remote-tracking branch 'origin/main' into hoc/channels-encryption-only-qrcodes 2025-09-09 19:34:37 +02:00
Hocuri
4c068e835b test: fix test_sync_broadcast() 2025-09-09 19:15:36 +02:00
iequidoo
b9ff40c6b5 test: Message is OutFailed if all keys are missing (#6849)
Follow-up to 143ba6d5e7 before which a message remained in
`OutPending` indefinitely in such a case.
2025-09-09 09:48:12 -03:00
iequidoo
0684810d38 refactor: prepare_msg_raw(): don't return MsgId
The function takes `&mut Message` and updates its `id` and `chat_id` before return.
2025-09-09 09:48:12 -03:00
Hocuri
18c84e838c Merge remote-tracking branch 'origin/main' into hoc/channels-encryption-only-qrcodes 2025-09-09 10:17:59 +02:00
Hocuri
1cc7ce6e27 api: Put the chattype into the SecurejoinInviterProgress event (#7181)
Quoting @adbenitez:

> I have been using the SecurejoinInviterProgress event to show a
welcome message when user scan the QR/link of the bot (== starts a chat
with the bot)

> but this have a big problem: in that event all you know is that a
contact completed the secure-join process, you don't know if it was via
certain 1:1 invite link or a group invitation, then a group-invite bot
would send you a help message in 1:1 every time you join a group with it

Since it's easy enough to add this information to the
SecurejoinInviterProgress event, I wrote a PR to do so.
2025-09-09 08:17:53 +00:00
link2xt
82bc1bf0b1 refactor: use recv_msg_trash() instead of recv_msg_opt() 2025-09-09 06:08:15 +00:00
link2xt
307a2eb6ec feat: withdraw all QR codes when one is withdrawn
This is a preparation for expiring authentication tokens.

If we make authentication token expire,
we need to generate new authentication tokens each time
QR code screen is opened in the UI,
so authentication token is fresh.
We however don't want to completely invalidate
old authentication codes at the same time,
e.g. they should still be valid for joining groups,
just not result in a verification on the inviter side.

Since a group now can have a lot of authentication tokens,
it is easy to lose track of them
without any way to remove them
as they are not displayed anywhere in the UI.
As a solution, we now remove all
tokens corresponding to a group ID
when one token is withdrawn,
or all non-group tokens
when a single non-group token is withdrawn.

"Reset QR code" option already present
in the UI which works by resetting
current QR code will work without any UI changes,
but will now result in invalidation
of all previously created QR codes and invite links.
2025-09-08 17:51:45 +00:00
bjoern
ab8aedf06e refine call states (#7179)
- sync declined calls from callee to caller, as usual in all larger
messengers
- introduce the call states "Missed call", "Declined call" and
"Cancelled all" ("Ended call" is gone)
- allow calling end_call()/accept_call() for already ended/accepted
calls, in practise, handling all cornercases is tricky in UI - and the
state needs anyways to be tracked.
- track and show the call duration

the duration calculation depends on local time, but it is displayed only
coarse and is not needed for any state. this can be improved as needed,
timestamps of the corresponding messages are probably better at some
point. or ending device sends its view of the time around. but for the
first throw, it seems good enough

if we finally want that set of states, it can be exposed to a json-info
in a subsequent call, so that the UI can render it more nicely. fallback
strings as follows will stay for now to make adaption in other UI easy,
and for debugging:

<img width="320" alt="IMG_0154"
src="https://github.com/user-attachments/assets/09a89bfb-66f4-4184-b05c-e8040b96cf44"
/>

successor of https://github.com/chatmail/core/pull/6650
2025-09-08 15:48:35 +02:00
Hocuri
b5a54aa6cf fix: Scaleup contact on securejoin, send more events, use correct create_blocked 2025-09-05 21:52:25 +02:00
Hocuri
60e4899b3a test: Add python test test_qr_securejoin_broadcast, and fix some small bugs I found on the way 2025-09-05 21:52:25 +02:00
Hocuri
8eb5fc528f Adapt to things that changed when I rebased 2025-09-05 21:52:25 +02:00
Hocuri
286f913f6e refactor: No need for observe_securejoin_on_other_device() for securejoin v2 2025-09-05 21:52:25 +02:00
Hocuri
6e68eb1c5d Resolve identity-misbinding TODO 2025-09-05 21:52:25 +02:00
Hocuri
153ced7141 Remove outdated TODO 2025-09-05 21:52:25 +02:00
Hocuri
4a9af2b600 refactor: Remove superflous check for ChatGroupMemberAdded 2025-09-05 21:52:25 +02:00
Hocuri
0c25646ac2 test: Add golden test for Alice's side, too, in test_sync_broadcast 2025-09-05 21:52:25 +02:00
Hocuri
019da70c8a test: When a golden test fails, print some extra info 2025-09-05 21:52:19 +02:00
bjoern
b6ab13f1de feat: hide call status change messages (#7175)
this PR uses the initial "call messages" (that has a separate viewtype
since #7174) to show all call status.

this is what most other messengers are doing as well. additional "info
messages" after a call are no longer needed.

on the wire, as we cannot pickpack on visible info messages, we use
hidden messages, similar to eg. webxdc status updates.

in future PR, it is planned to allow getting call state as a json, so
that UI can render nicely. it is then decided if we want to translate
the strings in the core.

<img width="320" alt="IMG_0150"
src="https://github.com/user-attachments/assets/41ee3fa3-8be4-42c3-8dd9-d20f49881650"
/>

successor of https://github.com/chatmail/core/pull/6650
2025-09-05 08:52:15 +02:00
link2xt
53a3e51920 feat: support receiving Autocrypt-Gossip with _verified attribute
This commit is a preparation for
sending Autocrypt-Gossip with `_verified` attribute
instead of `Chat-Verified` header.
2025-09-04 19:46:14 +00:00
link2xt
4033566b4a refactor: remove Aheader::new 2025-09-04 19:46:14 +00:00
bjoern
bed1623dcb feat: use dedicated 'call' viewtype (#7174)
a dedicated viewtype allows the UI to show a more advanced UI, but even
when using the defaults,
it has the advantage that incoming/outgoing and the date are directly
visible.

successor of https://github.com/chatmail/core/pull/6650
2025-09-04 16:51:51 +02:00
link2xt
d4704977bc api!: remove e2ee_enabled preference
The setting is already removed from the UIs,
but users who had it disabled previously have
no way to enable it. After this change
encryption is effectively always preferred.
2025-09-04 13:58:05 +00:00
link2xt
838eed94bc chore: update provider database 2025-09-04 13:58:05 +00:00
link2xt
9870725d1f refactor: remove unused EncryptPreference::Reset 2025-09-04 13:58:05 +00:00
Hocuri
19159c905f test: Rename alice0, alice1 to alice1, alice2 in test_sync_muted()
This makes the automatically generated "alice, alice2" context names
correct
2025-09-03 17:56:15 +02:00
Hocuri
51a36d23a2 small refactoring 2025-09-03 17:56:14 +02:00
Hocuri
f7844e97c2 fix: Don't show wrong system message on Bob's second device
Before this, Bob's second device showed a system message
"⚠️ It seems you are using Delta Chat on multiple devices that cannot
decrypt each other's outgoing messages..."
2025-09-03 17:56:14 +02:00
Hocuri
a3d1e3bc89 Remove TODO 2025-09-03 17:56:14 +02:00
Hocuri
dc5237f530 fix: Remove panic!() call 2025-09-03 17:56:14 +02:00
Hocuri
f66f6f3e92 refactor: Rename to symm_encrypt_message() 2025-09-03 17:56:14 +02:00
Hocuri
9b49386bc8 fix: Protect against DOS attacks via a message with many esks using expensive-to-compute s2k algos 2025-09-03 17:56:14 +02:00
Hocuri
40f4eea049 feat: Sync Alice's verification on Bob's side 2025-09-03 17:56:14 +02:00
Hocuri
00ba559562 Resolve some small TODOs 2025-09-03 17:56:14 +02:00
Hocuri
3a648698ee resolve some small TODOs 2025-09-03 17:56:14 +02:00
Hocuri
61e0d14eed refactor: Remove small code duplication 2025-09-03 17:56:14 +02:00
Hocuri
2efbbcc669 bench: Improve benchmark_decrypting.rs benchmark 2025-09-03 17:56:13 +02:00
Hocuri
479a5632fb feat: Make reacting to v2 invites generic over the type of the invite (contact/group/broadcast) 2025-09-03 17:56:13 +02:00
Hocuri
9dc590cb35 feat: Rename vb-request-v2 -> vb-request-with-auth
Turns out that Alice reacts to a request-v2 message in exactly the same
way as to a request-with-auth message. So, no need to distinguish here.
2025-09-03 17:56:13 +02:00
Hocuri
956519cd98 fix: Make sure that only the channel owner can write into the chat 2025-09-03 17:56:13 +02:00
Hocuri
90d4856a1c comments/naming: Make sure that I consistently use shared_secret 2025-09-03 17:56:13 +02:00
Hocuri
792c05fc3e fix: Don't show a weird 'Secure-Join: vb-request-v2 message' in Alice's 1:1 chat a recipient 2025-09-03 17:56:13 +02:00
Hocuri
3cf7746ceb Remove unnecessary TODO 2025-09-03 17:56:13 +02:00
Hocuri
0acc34a882 Notify a removed member that they were removed 2025-09-03 17:56:13 +02:00
Hocuri
378896eca3 docs: Fix wrong comment on msg_del_member_local() 2025-09-03 17:56:13 +02:00
Hocuri
265ac4e30b fix: Show only one member-added message for Bob 2025-09-03 17:56:12 +02:00
Hocuri
8d89dcc65f Add golden test that only one member-added message is shown for Bob 2025-09-03 17:56:12 +02:00
Hocuri
a858709301 Use translatable message for broadcast-joining 2025-09-03 17:56:12 +02:00
Hocuri
3d5e97eced No clippy warnings anymore! 2025-09-03 17:56:12 +02:00
Hocuri
5da6ca1ec4 test: Improve test_send_avatar_in_securejoin() 2025-09-03 17:56:12 +02:00