Skip to content

Conversation

@Hocuri
Copy link
Collaborator

@Hocuri Hocuri commented Nov 14, 2025

Fix #7435

For most messages, calc_sort_timestamp() makes sure that they are at the correct place; esp. that they are not above system messages or other noticed/seen messages.

Most callers of add_info_msg(), however, didn't call calc_sort_timestamp(), and just used time() or smeared_time() to get the sort timestamp. Because of this, system messages could sometimes wrongly be sorted above other messages.

This PR fixes this by making the sort timestamp optional in add_info_msg*(). If the sort timestamp isn't passed, then the message is sorted to the bottom of the chat. sent_rcvd_timestamp is not optional anymore, because we need some timestamp that can be shown to the user (most callers just pass time() there).

@Hocuri Hocuri changed the title fix: Sort system messages to the bottom of the chat fix: Sort most system messages to the bottom of the chat Nov 14, 2025
@Hocuri Hocuri requested review from iequidoo and link2xt November 14, 2025 14:17
--------------------------------------------------------------------------------
Msg#2004: info (Contact#Contact#Info): Establishing guaranteed end-to-end encryption, please wait… [NOTICED][INFO]
Msg#2003: info (Contact#Contact#Info): Messages are end-to-end encrypted. [NOTICED][INFO]
Msg#2004: info (Contact#Contact#Info): Establishing guaranteed end-to-end encryption, please wait… [NOTICED][INFO]
Copy link
Contributor

@r10s r10s Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should also change the default fallback text to "Establishing connection, please wait…" and change the example string in deltachat.h etc.

context: &Context,
timestamp_sort: i64,
) -> Result<()> {
pub(crate) async fn add_encrypted_msg(self, context: &Context, timestamp: i64) -> Result<()> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, the naming for this is weird. One may think that it adds an arbitrary encrypted message to the chat. Should be add_e2ee_notice() or so

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

odd order in initial system messages when secure-join is in progress

4 participants