Skip to content

make one-to-one chats read-only the first seconds of a secure-join #5512

Closed
@r10s

Description

@r10s

this issue is the outcome of the discussion at #5475: protecting Bob (the joiner) of sending unexpected-unencrypted messages during an otherwise nicely running secure-join.

if things get stuck, however, we do not want to block communication - the chat is just opportunistic as usual, but that needs to be communicated:

  1. If Bob's chat with Alice has no messages yet, securejoin is started, and Bob doesn't have Alice's key:
    add info-message Establishing guaranteed e2ee, please wait... and let chat_can_send() return false

  2. once the info-message Messages are guaranteed to be e2ee from now on is added, let chat_can_send() return true

  3. if after TIMEOUT seconds 2. did not happen, add another info-message Could not yet establish guaranteed e2ee but you may already send a message without 1 and also let chat_can_send() return true

both, 2. and 3. require the event DC_EVENT_CHAT_MODIFIED being sent out so that UI pick up the change wrt chat_can_send() (this is the same way how groups become updated wrt can-send-changes)

The TIMEOUT should be 10-20 seconds so that we are reasonably sure that the app remains active and receiving also on mobile devices.
If the app is killed during this time then we may need to do step 3 for any pending bob-join chats (right now, bob can only
join one chat at a time, see #2777)

this issue only affects one-to-one chats only - groups already have can_send() set to false until secure join is finished.

idea of this approach is to not clutter UI unnecessarily and to not add additional work to UI.

Footnotes

  1. to the exact wording can be refined later, it is mainly to get the flow right for now. at let UI know that a secure-join is ongoing #5475 there was also the suggestion to have different texts for "key there" and "key not there", saying that message may or may not be encrypted, however, that seems tricky as the chat is opportunistic, things may change at any time, so i left that out; but once the flow is there, this can also be refined easily

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions