Skip to content

Commit 66e4833

Browse files
committed
Check for add_timestamp >= remove_timestamp in shall_attack_selfavatar
1 parent f4ca4f3 commit 66e4833

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/chat.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3798,9 +3798,9 @@ pub(crate) async fn shall_attach_selfavatar(context: &Context, chat_id: ChatId)
37983798
.sql
37993799
.query_map(
38003800
"SELECT c.selfavatar_sent
3801-
FROM chats_contacts cc
3802-
LEFT JOIN contacts c ON c.id=cc.contact_id
3803-
WHERE cc.chat_id=? AND cc.contact_id!=?;",
3801+
FROM chats_contacts cc
3802+
LEFT JOIN contacts c ON c.id=cc.contact_id
3803+
WHERE cc.chat_id=? AND cc.contact_id!=? AND cc.add_timestamp >= cc.remove_timestamp",
38043804
(chat_id, ContactId::SELF),
38053805
|row| Ok(row.get::<_, i64>(0)),
38063806
|rows| {

0 commit comments

Comments
 (0)