Skip to content

Commit 2f93ea9

Browse files
committed
Do not allow to add self to fix AEAP
1 parent c5b004e commit 2f93ea9

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/receive_imf.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2283,13 +2283,15 @@ async fn apply_group_changes(
22832283
to_ids.iter(),
22842284
chat_group_member_timestamps.iter().take(to_ids.len()),
22852285
) {
2286-
transaction.execute(
2287-
"INSERT INTO chats_contacts (chat_id, contact_id, add_timestamp)
2288-
VALUES (?1, ?2, ?3)
2289-
ON CONFLICT (chat_id, contact_id)
2290-
DO UPDATE SET add_timestamp=MAX(add_timestamp, ?3)",
2291-
(chat_id, contact_id, ts),
2292-
)?;
2286+
if *contact_id != from_id {
2287+
transaction.execute(
2288+
"INSERT INTO chats_contacts (chat_id, contact_id, add_timestamp)
2289+
VALUES (?1, ?2, ?3)
2290+
ON CONFLICT (chat_id, contact_id)
2291+
DO UPDATE SET add_timestamp=MAX(add_timestamp, ?3)",
2292+
(chat_id, contact_id, ts),
2293+
)?;
2294+
}
22932295
}
22942296

22952297
for (contact_id, ts) in std::iter::zip(

0 commit comments

Comments
 (0)