store: add support for modifying and listing labels and caching

Add methods update_labels, clear_labels which update or clear the labels for a
message in the store, and update the cache with the overall counts of labels.

Add a LabelsCache to keep track of the counts and labels_map() to retrieve that
map.
This commit is contained in:
Dirk-Jan C. Binnema
2025-07-27 09:19:48 +03:00
parent 552bb3a7c8
commit 1e628dfcab
4 changed files with 257 additions and 3 deletions

View File

@ -41,8 +41,9 @@ struct Property {
enum struct Id {
BatchSize, /**< Xapian batch-size */
Contacts, /**< Cache of contact information */
Created, /**< Time of creation */
Created, /**< Time of creation */
IgnoredAddresses, /**< Email addresses ignored for the contacts-cache */
Labels, /**< Serialized label information. */
LastChange, /**< Time of last change */
LastIndex, /**< Time of last index */
MaxMessageSize, /**< Maximum message size (in bytes) */
@ -130,6 +131,16 @@ public:
"E-mail addresses ignored for the contacts-cache, "
"literal or /regexp/"
},
{
Id::Labels,
Type::String,
Flags::Internal,
"labels",
{},
"Serialized labels information"
},
{
Id::LastChange,
Type::Timestamp,