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
@Hocuri Hocuri force-pushed the hoc/calc-timestamp-for-info-msgs branch 2 times, most recently from f2d5eb9 to baef3fa Compare November 18, 2025 15:04
@Hocuri Hocuri enabled auto-merge (rebase) November 18, 2025 15:05
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 force-pushed the hoc/calc-timestamp-for-info-msgs branch from baef3fa to 17c9d6a Compare November 18, 2025 17:40
@Hocuri Hocuri merged commit 713c929 into main Nov 18, 2025
47 of 54 checks passed
@Hocuri Hocuri deleted the hoc/calc-timestamp-for-info-msgs branch November 18, 2025 17:58
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