feat: Add silent group changes messages as InNoticed, not InSeen

This way they also can be processed by `markseen_msgs()` resulting in MDNs which improves
multi-device synchronization and updates contacts' `last_seen`. I.e. leave it up to the UIs.
This commit is contained in:
iequidoo
2026-01-25 03:50:47 -03:00
parent e14151d6cc
commit 196befa658
2 changed files with 3 additions and 6 deletions

View File

@@ -746,7 +746,7 @@ async fn test_leave_group() -> Result<()> {
assert_eq!(get_chat_contacts(&alice, alice_chat_id).await?.len(), 1);
assert_eq!(rcvd_leave_msg.state, MessageState::InSeen);
assert_eq!(rcvd_leave_msg.state, MessageState::InNoticed);
alice.emit_event(EventType::Test);
alice

View File

@@ -1853,14 +1853,11 @@ async fn add_parts(
let state = if !mime_parser.incoming {
MessageState::OutDelivered
} else if seen
|| !mime_parser.mdn_reports.is_empty()
|| chat_id_blocked == Blocked::Yes
|| group_changes.silent
} else if seen || !mime_parser.mdn_reports.is_empty() || chat_id_blocked == Blocked::Yes
// No check for `hidden` because only reactions are such and they should be `InFresh`.
{
MessageState::InSeen
} else if mime_parser.from.addr == STATISTICS_BOT_EMAIL {
} else if mime_parser.from.addr == STATISTICS_BOT_EMAIL || group_changes.silent {
MessageState::InNoticed
} else {
MessageState::InFresh