Skip to content

Commit 103f727

Browse files
committed
Treat member as part of the chat only if add_timestamp >= remove_timestamp
1 parent 80a4c32 commit 103f727

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/chat.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -2780,7 +2780,9 @@ pub async fn is_contact_in_chat(
27802780
let exists = context
27812781
.sql
27822782
.exists(
2783-
"SELECT COUNT(*) FROM chats_contacts WHERE chat_id=? AND contact_id=?;",
2783+
"SELECT COUNT(*) FROM chats_contacts
2784+
WHERE chat_id=? AND contact_id=?
2785+
AND add_timestamp >= remove_timestamp",
27842786
(chat_id, contact_id),
27852787
)
27862788
.await?;

0 commit comments

Comments
 (0)