Skip to content
Commit e49f49a1 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

Fix clearing Item flags

For instance when an email is marked as unread on an IMAP server, it
means that the \\SEEN flag is removed. If this was the only flag
set on the email, then Akonadi::ItemSync will end up calling
Akonadi::Item::setFlags() with an empty QSet. When the AKAPPEND handler
is in the MERGE mode and runs into an empty Flags field in the
CreateItemCommand it fallsback to checking AddedFlags and RemovedFlags
fields, but those are empty too.

Akonadi::Item internally tracks when setFlags() is called, even with
an empty QSet through flagsOverwritten flag. With this change the
flag is sent as part of the command to the server and the AKAPPEND
handler now falls back to AddedFlags/RemovedFlags fields only if
the flag is false.

This fixes syncing email flags when email state changes from read to
unread on IMAP, but due to how IMAP emails are synced this will only
affect future changes and will not sync existing out-of-sync emails.

BUG: 375146
FIXED-IN: 5.5.1
parent 2e91f5f0
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment