Skip to content

Commit

Permalink
Do not allow to add self to fix AEAP
Browse files Browse the repository at this point in the history
  • Loading branch information
link2xt committed Jan 7, 2025
1 parent c5b004e commit 2f93ea9
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/receive_imf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2283,13 +2283,15 @@ async fn apply_group_changes(
to_ids.iter(),
chat_group_member_timestamps.iter().take(to_ids.len()),
) {
transaction.execute(
"INSERT INTO chats_contacts (chat_id, contact_id, add_timestamp)
VALUES (?1, ?2, ?3)
ON CONFLICT (chat_id, contact_id)
DO UPDATE SET add_timestamp=MAX(add_timestamp, ?3)",
(chat_id, contact_id, ts),
)?;
if *contact_id != from_id {
transaction.execute(
"INSERT INTO chats_contacts (chat_id, contact_id, add_timestamp)
VALUES (?1, ?2, ?3)
ON CONFLICT (chat_id, contact_id)
DO UPDATE SET add_timestamp=MAX(add_timestamp, ?3)",
(chat_id, contact_id, ts),
)?;
}
}

for (contact_id, ts) in std::iter::zip(
Expand Down

0 comments on commit 2f93ea9

Please sign in to comment.