Mailbox-Alert icon indicating copy to clipboard operation
Mailbox-Alert copied to clipboard

Support Thunderbird 115

Open Dtrieb opened this issue 1 year ago • 15 comments

Please add Support for Thunderbird 115

Dtrieb avatar Jul 17 '23 17:07 Dtrieb

Looks like the basics work, but due to the new UI changes the alert_list on folders doesn't appear, so will need tweaking

EnigmaPatrick avatar Jul 17 '23 21:07 EnigmaPatrick

Well, it doesn't appear to be a one-evening fix; they also changed something in how scripts are loaded and scoped, so I think only part of the initialization is running (the Services object is now global, but that's not all; it looks like the loadSubscript() call has changed too, and I can't find any info on how or what).

tjeb avatar Jul 17 '23 21:07 tjeb

Not sure if this is any help: https://developer.thunderbird.net/add-ons/updating/tb115/adapt-to-changes-in-thunderbird-103-115

EnigmaPatrick avatar Jul 17 '23 21:07 EnigmaPatrick

After https://github.com/tjeb/Mailbox-Alert/pull/71 was merged, you can now use browser.menus.create() in the background to build your localized menu structure in the tools_menu context and the folder_pane context: https://webextension-api.thunderbird.net/en/stable/menus.html#contexttype

Feel free to ping me if you need additional pointers.

An example add-on which uses the menus API to build a complex menu structure is the profile switcher add-on: https://addons.thunderbird.net/addon/profile-switcher/versions/?page=1#version-2.6

jobisoft avatar Jul 24 '23 07:07 jobisoft

@jobisoft Any idea how to get the equivalent of nsIMsgFolder.URI? I can fetch most data (side gripe: why is every basic call async now) but I can't seem to find an equivalent for the accounts incoming server name in the new API (which is part of the original folder URI).

Another nice thing I used to have it that when clicking on checkmark-type menu items I could simply add 'false' to the listener registration so that the checkmark could be toggled, but the menu would stay open. Is there a way to configure that in the new menu api?

tjeb avatar Jul 31 '23 15:07 tjeb

side gripe: why is every basic call async now

That is actually an advantage and makes sure add-ons do not hang/kill the system. Just do not use .then() callbacks but async functions and your code does not look any different (except the async/await keywords).

jobisoft avatar Jul 31 '23 15:07 jobisoft

Another nice thing I used to have it that when clicking on checkmark-type menu items I could simply add 'false' to the listener registration so that the checkmark could be toggled, but the menu would stay open. Is there a way to configure that in the new menu api?

Never did that myself, will check.

jobisoft avatar Jul 31 '23 15:07 jobisoft

That is actually an advantage and makes sure add-ons do not hang/kill the system. Just do not use .then() callbacks but async functions and your code does not look any different (except the async/await keywords).

Yes that's what I've been doing, it's just that it feels weird for getter functions for essentially static data (and async functions with await every other line feel a bit weird too)

tjeb avatar Jul 31 '23 15:07 tjeb

Any idea how to get the equivalent of nsIMsgFolder.URI?

What do you need the URI for in WebExtension land? There we have accountId + path. In an experiment you can get the URI from a WebExtension accountId + path via:

let realFolder = context.extension.folderManager.get(accountId, path);

See this section (and the next one) for a bunch of useful conversion helpers: https://webextension-api.thunderbird.net/en/stable/how-to/experiments.html#using-folder-and-message-types

jobisoft avatar Jul 31 '23 15:07 jobisoft

Yes that's what I've been doing, it's just that it feels weird for getter functions for essentially static data (and async functions with await every other line feel a bit weird too)

Is it static? What data are you pulling? Could it not have been changed in the meantime?

jobisoft avatar Jul 31 '23 15:07 jobisoft

What do you need the URI for in WebExtension land?

The folder URI is how alerts are matched to folders; changing to a different convention there would mean a non-reversible configuration update automation that i was hoping to circumvent for now.

tjeb avatar Jul 31 '23 15:07 tjeb

Is it static? What data are you pulling? Could it not have been changed in the meantime?

sorry, I mean 'static' as in globally available directly and always up-to-date, not as in 'does not change', never mind this thread of discussion :)

tjeb avatar Jul 31 '23 15:07 tjeb

If you still have an Experiment in your add-on, then you can of course add another Experiment to return the URI to the WebExtension to be able to compare it with stored data, but if you are almost a pure WebExtension and this matching part is the only remaining Experiment, I would try to migrate the stored data from URI to path.

jobisoft avatar Jul 31 '23 15:07 jobisoft

Can someone please take over this add on if the original author is unable to? This is mandatory for me and my multiple inboxes.

I'm stuck on 102 and refuse to update to 115 because of this.

godzfire avatar Nov 03 '23 21:11 godzfire

@jobisoft @tjeb how did you resolve this, as Components.classes["@mozilla.org/process/util;1"] is not available any more to launch external commands?

bf avatar Jan 25 '24 14:01 bf