Opened 14 years ago
Closed 13 years ago
#7458 closed bug (fixed)
New Mail menu item not decrementing
Reported by: | jalopeura | Owned by: | czeidler |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Kits/Mail Kit | Version: | R1/Development |
Keywords: | new mail menu gsoc2011 | Cc: | jalopeura@… |
Blocked By: | Blocking: | #7748 | |
Platform: | All |
Description
If I open a mail and read it, the New Mail menu item decrements the count of new mails. However, if I use the Tracker add-on to mark it read, it does not.
If I click on the menu item, the new mail window shows up and it's empty. But the mailbox icon is full and the count in the menu item is not 0.
Attachments (1)
Change History (16)
comment:1 by , 14 years ago
Cc: | added |
---|
follow-up: 3 comment:2 by , 14 years ago
comment:3 by , 14 years ago
Replying to czeidler:
Could you point me to the tracker add-on? it needs some changes too. I introduced another attribute that set the real status, e.g. the string can't be unread and forwarded...
http://dev.haiku-os.org/browser/haiku/trunk/src/add-ons/tracker/mark_as
comment:4 by , 14 years ago
ok that was easy :) will fix it soon... @jalopeura you can try to fix it yourself there is a function for that in libmail.so...
comment:5 by , 14 years ago
patch: | 0 → 1 |
---|
comment:6 by , 14 years ago
I added a patch to fix the Mark As add-ons. It still changes MAIL:status, but now it also changes MAIL:read.
Once the new add-ons have been installed, the menu problem can be fixed by running the following query:
(((MAIL:status=="Read")&&(MAIL:read==0))&&(BEOS:TYPE=="text_x-email"))
Then "Select all" and use the add-on to mark them read.
comment:7 by , 14 years ago
Keywords: | gsoc2011 added |
---|
comment:8 by , 14 years ago
Thanks for the patch! sorry was not very clear in my previous post. There is a helper function in: headers/private/mail/mail_util.h
write_read_attr
think its better to use this function. Probably you have to include the private header path in the Jamfile...
comment:9 by , 14 years ago
I discovered that the code in my previous patch would overwrite B_READ with B_SEEN. So I fixed that.
Note that using "Mark As..." and selecting "Read" will still overwrite B_READ with B_SEEN. I can fix that if desired, but it will require moving some code around a little bit.
comment:10 by , 14 years ago
Sorry, I hadn't seen the last comment (comment8) when I posted (comment9).
I'm stuck on Windows (doing some word processing) at the moment, but I'll look at those functions later on today.
comment:11 by , 14 years ago
Okay, it's now using the mail_util functions.
I noticed while doing this that users can add additional statuses by making a <settings>/Mail/status directory and creating empty files in it. It would be nice to make it so these were not empty files, but contained the value to put into MAIL:read. That way users could map each of their custom status strings to a read_flags value. Perhaps empty files would mean to not change MAIL:read. But I didn't want to make such a drastic change in a bugfix.
comment:12 by , 14 years ago
Sorry again! was a little bit busy when writing the last comment missed an important part :( the right solution is to go over the mail_daemon: https://dev.haiku-os.org/browser/haiku/trunk/headers/os/mail/MailDaemon.h
there is a MarkAsRead method which send a message to the daemon. The daemon dispatch it to the right add-on and the add-on do the work depending on the protocol... This is necessary because for example the IMAP add-on also sets the read status on the server. This would not happen in the previous solution.
To your proposal, think it is a good idea. I think its better to use the status file as a template for the attributes. For example, you can just at a MAIL:read attribute to the status template file...
comment:13 by , 14 years ago
Blocking: | 7748 added |
---|
comment:14 by , 13 years ago
Applied as hrev42972 with some changes to use the BMailDaemon::MarkAsRead() method. Maybe we'd want to add other methods to mark as new again as well ? It seems to work here but I didn't test all cases nor with an IMAP server, so please test.
comment:15 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Could you point me to the tracker add-on? it needs some changes too. I introduced another attribute that set the real status, e.g. the string can't be unread and forwarded...