Haiku's Email new emails query includes email files in Trash (it shouldn't)
|Reported by:||koki||Owned by:||anevilyak|
|Keywords:||new emails trash||Cc:|
|Has a Patch:||no||Platform:||All|
The new emails query used by the mail replicant in the Deskbar includes new emails that have been deleted and moved to the system Trash. This has two undesired side-effects:
1) If the user deletes one or more unread messages and then reads all the remaining emails, the Deskbar replicant icon will still indicate the presence of unread emails (because there are one or more unread emails in the Trash). This is misleading, as from a user POV, only the files in the "live" file system are relevant.
2) In such situations, the following inconsistency is also created: the Deskbar replicant icon indicates the presence of new email(s) and there is an "x new message(s)" entry in the Email replicant menu, but when you open it, the submenu is empty (it shows "Empty folder").
Expected behavior: if a user has deleted a message, it means that it is of no interest to him/her; this is regardless of the whether the message has been read or not. So, the query that drives the email Deskbar replicant should only consider relevant the emails messages in the "live" file system, that is, without including the Trash.