From aab29a1c452d2b27bf5be56cbb492595422895f7 Mon Sep 17 00:00:00 2001 From: link2xt Date: Thu, 3 Oct 2024 03:44:21 +0000 Subject: [PATCH] fix: do not reference info messages In particular, for newely promoted group we previously referenced info message saying "Others will only see this group after you sent a first message." and for the receiver it looked like there was some previous message that was not delivered. --- src/chat.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/chat.rs b/src/chat.rs index 6c1b727bd4..df58cc4b97 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -1234,6 +1234,7 @@ impl ChatId { AND ((state BETWEEN {} AND {}) OR (state >= {})) \ AND NOT hidden \ AND download_state={} \ + AND from_id != {} \ ORDER BY timestamp DESC, id DESC \ LIMIT 1;", MessageState::InFresh as u32, @@ -1242,6 +1243,9 @@ impl ChatId { // Do not reply to not fully downloaded messages. Such a message could be a group chat // message that we assigned to 1:1 chat. DownloadState::Done as u32, + // Do not reference info messages, they are not actually sent outside + // and have Message-IDs unknown to other chat members. + ContactId::INFO.to_u32(), ); sql.query_row_optional(&query, (self,), f).await }