Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
- do not delete messages without Message-IDs as duplicates #3095
- Assign replies from a different email address to the correct chat #3119
- start ephemeral timer when seen status is synchronized via IMAP #3122
- do not delete duplicate messages on IMAP immediately to accidentally deleting
the last copy #3138

### Changes
- add more SMTP logging #3093
Expand Down
21 changes: 1 addition & 20 deletions src/imap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -713,19 +713,6 @@ impl Imap {
None => folder.to_string(),
};

let duplicate = context
.sql
.count(
"SELECT COUNT(*)
FROM imap
WHERE rfc724_mid=?
AND folder=?
AND uid<?",
paramsv![message_id, &target, uid],
)
.await?
> 0;

context
.sql
.execute(
Expand All @@ -734,13 +721,7 @@ impl Imap {
ON CONFLICT(folder, uid, uidvalidity)
DO UPDATE SET rfc724_mid=excluded.rfc724_mid,
target=excluded.target",
paramsv![
message_id,
folder,
uid,
uid_validity,
if duplicate { "" } else { &target }
],
paramsv![message_id, folder, uid, uid_validity, &target],
)
.await?;

Expand Down