Ximi1970 / systray-x

SysTray-X: A system tray extension for Thunderbird. Needs both the addon AND the companion app installed to work. Will not work with TB flatpaks or snaps.
Mozilla Public License 2.0
214 stars 14 forks source link

New mail counter #116

Closed Ximi1970 closed 2 years ago

Ximi1970 commented 2 years ago

Is your feature request related to a problem? Please describe. New mail counter can be implemented again using new API calls

Describe the solution you'd like Show new mail instead of unread mail count

mjeveritt commented 2 years ago

Will this be available for Tb <=100 ?

Ximi1970 commented 2 years ago

Was already available for TB <= 90. But I do not know if it ever worked because I never used it or checked it. It was part of the old FireTray addon logic. I have now implemented a new 'new' count using the newer API calls and is enabled for versions TB 91 and up.
Do not know if it is any good :-). I tried to emulate the new indication and clearance of TB 102.0b7.

You can find the new implementation in this branch for now: feature-new-mail

mjeveritt commented 2 years ago

Looks like I misquoted previously, yes, >=91 was what I meant! :smiley:

Yes, this feature is the killer for me, so I can verify/test it works roughly as expected. Is there a build available, or is it reasonably easy to make from the repo source?* Thanks for your efforts!

* Figured from docs!

mjeveritt commented 2 years ago

Some debug data - does this look right? -

    <anonymous> moz-extension://364fd85e-69ea-4adf-823e-be49a1d09af9/punycode/punycode.js:440
punycode.js:440:1
sendRemoveListener on closed conduit systray-x@Ximi1970.137438953521 ConduitsChild.jsm:108
Starting SysTray-X background.js:978:9
Info Addon version: 0.8.0 background.js:16:13
Info Platform: {"os":"linux","arch":"x86-64"} background.js:17:13
Info Browser: {"name":"Thunderbird","vendor":"","version":"91.9.1","buildID":"20220520005021","majorVersion":"91","minorVersion":"9"} background.js:18:13
Using local storage 10 defaults.js:9:13
Accounts: [{"id":"account1","name":"michael@2e0cer.net","type":"imap","folders":[{"accountId":"account1","name":"Drafts","path":"/Drafts","type":"drafts","subFolders":[]},{"accountId":"account1","name":"Spam","path":"/Spam","type":"junk","subFolders":[]},{"accountId":"account1","name":"Sent Items","path":"/Sent Items","type":"sent","subFolders":[]},{"accountId":"account1","name":"Templates","path":"/Templates","type":"templates","subFolders":[]},{"accountId":"account1","name":"Archives","path":"/Archives","type":"archives","subFolders":[]},{"accountId":"account1","name":"Deleted","path":"/Trash","type":"trash","subFolders":[]},{"accountId":"account1","name":"Inbox","path":"/INBOX","type":"inbox","subFolders":[{"accountId":"account1","name":"Blogtrottr","path":"/INBOX/Blogtrottr","subFolders":[{"accountId":"account1","name":"BBC","path":"/INBOX/Blogtrottr/BBC","subFolders":[]},{"accountId":"account1","name":"Pentoo","path":"/INBOX/Blogtrottr/Pentoo","subFolders":[]},{"accountId":"accoun…
background.js:94:15
Using local storage defaults.js:9:13
Stored filters: [{"accountId":"account1","version":"0.8.0","folders":["/INBOX","/INBOX/Egress-mail"]},{"accountId":"account3","version":"0.8.0","folders":["/INBOX"]},{"accountId":"account5","version":"0.8.0","folders":["/INBOX"]}] defaults.js:254:15
Using local storage defaults.js:9:13
Error: Can't find profile directory. 2 XULStore.jsm:66:15
    load resource://gre/modules/XULStore.jsm:66
    XULStore resource://gre/modules/XULStore.jsm:24
Using local storage 4 defaults.js:9:13
New mail in: account1, /INBOX/Blogtrottr background.js:178:13
New messages: {"id":null,"messages":[{"id":63,"date":"2022-06-21T00:00:46.000Z","author":"\"Blogtrottr\" <busybee@blogtrottr.com>","recipients":["michael@2e0cer.net"],"ccList":[],"bccList":[],"subject":"src_prepare Overlay:master commits","read":false,"flagged":false,"junk":false,"junkScore":0,"headerMessageId":"20220621000046.57B4F3ED2D@qw43.blogtrottr.com","size":30695,"folder":{"accountId":"account1","name":"Blogtrottr","path":"/INBOX/Blogtrottr"},"tags":[]}]} background.js:179:13
Messages: [{"id":63,"date":"2022-06-21T00:00:46.000Z","author":"\"Blogtrottr\" <busybee@blogtrottr.com>","recipients":["michael@2e0cer.net"],"ccList":[],"bccList":[],"subject":"src_prepare Overlay:master commits","read":false,"flagged":false,"junk":false,"junkScore":0,"headerMessageId":"20220621000046.57B4F3ED2D@qw43.blogtrottr.com","size":30695,"folder":{"accountId":"account1","name":"Blogtrottr","path":"/INBOX/Blogtrottr"},"tags":[]}] background.js:195:15
New mail in: account1, /INBOX/Blogtrottr background.js:178:13
New messages: {"id":null,"messages":[{"id":63,"date":"2022-06-21T00:00:46.000Z","author":"\"Blogtrottr\" <busybee@blogtrottr.com>","recipients":["michael@2e0cer.net"],"ccList":[],"bccList":[],"subject":"src_prepare Overlay:master commits","read":false,"flagged":false,"junk":false,"junkScore":0,"headerMessageId":"20220621000046.57B4F3ED2D@qw43.blogtrottr.com","size":30695,"folder":{"accountId":"account1","name":"Blogtrottr","path":"/INBOX/Blogtrottr"},"tags":[]}]} background.js:179:13
Messages: [{"id":63,"date":"2022-06-21T00:00:46.000Z","author":"\"Blogtrottr\" <busybee@blogtrottr.com>","recipients":["michael@2e0cer.net"],"ccList":[],"bccList":[],"subject":"src_prepare Overlay:master commits","read":false,"flagged":false,"junk":false,"junkScore":0,"headerMessageId":"20220621000046.57B4F3ED2D@qw43.blogtrottr.com","size":30695,"folder":{"accountId":"account1","name":"Blogtrottr","path":"/INBOX/Blogtrottr"},"tags":[]},{"id":63,"date":"2022-06-21T00:00:46.000Z","author":"\"Blogtrottr\" <busybee@blogtrottr.com>","recipients":["michael@2e0cer.net"],"ccList":[],"bccList":[],"subject":"src_prepare Overlay:master commits","read":false,"flagged":false,"junk":false,"junkScore":0,"headerMessageId":"20220621000046.57B4F3ED2D@qw43.blogtrottr.com","size":30695,"folder":{"accountId":"account1","name":"Blogtrottr","path":"/INBOX/Blogtrottr"},"tags":[]}] background.js:195:15
mjeveritt commented 2 years ago

Working fine with Inbox messages so far .. :D

Ximi1970 commented 2 years ago

Will merge it with develop and create a new release compatible for TB 102.0

mjeveritt commented 2 years ago

FYI - there is an odd quirk where there is a 'left-over' 1 New message that refuses to go away, until you select the Inbox for each mail account AND then also another subfolder of Inbox, and returning to the Inbox for that account to clear it. No idea why that seems to cure it, but is a right pain! :grin:

TB 91.9.1 Ubuntu 18.04 LTS KDE plasma5

mjeveritt commented 2 years ago

FYI - there is an odd quirk where there is a 'left-over' 1 New message that refuses to go away, until you select the Inbox for each mail account AND then also another subfolder of Inbox, and returning to the Inbox for that account to clear it. No idea why that seems to cure it, but is a right pain! grin

TB 91.9.1 Ubuntu 18.04 LTS KDE plasma5

I wonder if this may be related to this logic

Ximi1970 commented 2 years ago

Tried to emulate the new mail behavior in the betas. Looks like they changed it again. Will try to emulate it again. The api for new mail is still hopeless and needs "manual" checking.

Ximi1970 commented 2 years ago

Should be solved in the release.