The idea being that if we've returned into the foreground while old
message detachment was running the remaining background cleanup tasks
shouldn't be run.
Monitor folder checking operations so we can perform garbage collection
once any message detaching has finished. WIP as this is a second
mechanism for triggering GC after folder checks have completed. Need to
discuss.
Also handle continuation of cleanup after old messages have been
detached. Flagged vacuuming is performed even when the cleanup
interval hasn't been reached. The tracking of last background
cleanup time in Account.Information is possibly temporary and isn't
yet persisted.
The idea here being if we've just reduced prefetch period, reap has
detached a whole lot of messages and we want to vacuum. This check
catches that vacuum recommendation, flagging it to run when the app
is backgrounded and idle.
Including:
- Moved into method run_gc
- Added ability to force reap (useful after old message cleanup when we
don't want to wait the regular 10 day span)
- Added tracking of desire to vacuum, which will later by executed when
backgrounded for a period
- Disabled vacuum on startup
- Added stopping IMAP while vacuuming
- Used ugly WIP hack of passing through account to stop IMAP
Split detach query into two so that messages identifiers can be captured
which are then used to signal through that the folder has locally
removed messages
It would be best to use meson feature option type for ytnef and unwind,
but for now fix the automagic dependency on ytnef with the existing
meson_options.txt setup.
It was adding ytnef to list of dependencies unconditionally, and then
also if tnef-support was enabled. So if the option was disabled, but the
pkg-config file was present, it would still link to it surprisingly.
Just remove the unconditional addition to dep, and rely on the already
existing conditional addition to deps.
The only reason SearchFolder.EmailIdentifier exists was to store the
date for ordering the folder, but that can be done with any old class,
meaning we can simply pass though existing ImapDb ids to clients, fixing
a lot of bugs and corner cases along the way.
Rename the search folder again to App.SearchFolder, move its id class
into it as an inner class. Remove search folder from the engine so the
application can manage it and it's policy in the future. Also remove
the outbox from the accout's list of local folders, so that code can
be removed altogether.
Move SearchFolder and search EmailIdentifier implementation out of
ImapDb and into its own package. Decouple both from ImapDB, and improve
the implementation, fixing a few inefficiencies. Merge search
FolderProperties into the SearchFoldern implementation as an inner
class.
Merge SearchTerm into ImapDB.SearchQuery as an inner class and move the
outer class's source down a level, since it was the only file left in
the imap-db/search dir.
Make subclasses implement these themselves and remove the unique string
property, to be (hopefully) more efficient and easier for subclasses
to specialise.