Now that the new MAIL:label attribute has been made available in nightly images, I’m looking into implementing assigning a label to an email in the Mail app. See also https://discuss.haiku-os.org/t/introducing-a-new-indexed-attribute-meta-tag
I have two questions:
1. Assigning statuses
The new label attribute was introduced to do away with abusing MAIL:status, which should be reserved for actual email status like New, Seen, Read, Replied, Answered, Pending, Sent.
We should still keep a menu around to allow the user to switch between the status New and Read. But all other statuses won’t be available, that’s what the new labels are for. Right?
Now, do we have to come up with a sort of migration from old custom statuses to new labels?
If so, would a script that moves all emails’ custom MAIL:status to MAIL:label be enough? How can we make sure the script is run once? Or is it OK to point to the script in the next release notes and maybe the User guide?
2. Implementing labels
I originally thought to implement labels 1:1 to how statuses are managed in Mail, but after having a look, I’m not so sure. This is how it works now:
The Mail app queries the boot partition for all files with the indexed attribute “_status” and generates a list from the result to present to the user in a menu. User-created statuses are saved with a “_status” attribute in ~/config/settings/Mail/status.
Isn’t that quite a bit complicated? Do people create their own statuses, assign a “_status” attribute and save them somewhere else on the boot partition?
(In the future those statuses aren’t needed, we can simply hard-code the two options a user has to switch between New and Read.)
For the new labels though, shouldn’t we simply save the user labels into ~/config/settings/Mail/labels and just iterate over the file names there to put in the menu?
I hope I didn’t bite off more than I can chew here, put I’m willing to give that label implementation a stab… ![]()