Do not reply to hidden messages

Especially with read receipts, it is wrong, because they are never
encrypted and their Message-IDs are not known to other users in a group.
This commit is contained in:
Alexander Krotov
2020-05-08 00:48:20 +03:00
committed by link2xt
parent a586a1d525
commit 2dbb1bbbea

View File

@@ -385,7 +385,7 @@ impl ChatId {
let sql = &context.sql;
let query = format!(
"SELECT {} \
FROM msgs WHERE chat_id=? AND state NOT IN (?, ?, ?, ?) \
FROM msgs WHERE chat_id=? AND state NOT IN (?, ?, ?, ?) AND NOT hidden \
ORDER BY timestamp DESC, id DESC \
LIMIT 1;",
fields