Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make QuickFolders compatible with Thunderbird 91. (ESR 2021/22) #114

Closed
RealRaven2000 opened this issue Feb 20, 2021 · 22 comments
Closed

Make QuickFolders compatible with Thunderbird 91. (ESR 2021/22) #114

RealRaven2000 opened this issue Feb 20, 2021 · 22 comments
Assignees

Comments

@RealRaven2000
Copy link
Owner

There are a number of things that don't work in the latest beta for Thunderbird 86, so far I have discovered:

  • Options screen is misaligned (especially support and layout tabs) due to missing grid support
  • Search popup have stopped working
  • (add more later)
@RealRaven2000
Copy link
Owner Author

Quick fixes for the first two items listed above:

QuickFolders-wx-5.3pre54.zip

To install, download the zip file and drag into Thunderbird Add-ons manager. This version should also be compatible with Thunderbird 78, so feel free to test there as well and leave comments below:

@aprojanos71
Copy link

Works fine!
Thx!

(You are very quick!) 👍🏼

@RealRaven2000
Copy link
Owner Author

RealRaven2000 commented Feb 20, 2021

Works fine!
Thx!

(You are very quick!) 👍🏼

Yeah, I already had found that grid bug earlier and only just discovered the search not working while messing around with quickFilters. That's why I decided to create a catch-all bug for Thunderbird 86 like in quickFilters, so I can hit the ground running later this year when the ESR rolls around once more. The changes aren't quite as fundamental as having to drop the legacy flag altogether (as Thunderbird 78 required) but my guess is they will be more numerous this year because Thunderbird will force developers to publish new Add-ons as "Mail extensions" - with native APIs only.

Which means they can do more internal changes / refactoring and care about internal dependencies of our code less - if we still use the legacy methods of "hacking the internals" - like all my Add-ons we have to once again blame ourselves if we can't keep up. At the moment I am solving the problems with "wrapper code" - so I am writing functions that "translate" between both behaviors, but I had dropped a lot of that in Tb78 because I was forced to fork my code into a new branch - which effectively doubles my workload whenever I try to back-port bug fixes / features for Thunderbird 68. Once I release for 88 I will probably freeze all work on Thunderbird 68 because it will only have diminishing returns at that stage.

@RealRaven2000
Copy link
Owner Author

First two items fixed in 5.3 - released 22/02/2021. Please add more defects / regressions for Tb86 / later below.

@RealRaven2000
Copy link
Owner Author

More defects found in Tb 88:

  • subfolders are not shown in subfolder dropdowns that are displayed when right-clicking a Tab
  • folder navigation next / previous "sibling" folder don't work.

These are caused by folder.subFolders having been changed from an nsIMutableArray to an Array. I added some wrapper code so that it will work both in Tb78 and in the newer versions as well. quickFix tested in Thunderbird 87.0b1

QuickFolders-wx-5.4pre16.zip

@RealRaven2000 RealRaven2000 changed the title Make QuickFolders compatible with Thunderbird beta 86.0b3 Make QuickFolders compatible with Thunderbird beta 87.0b1 Mar 2, 2021
@RealRaven2000
Copy link
Owner Author

Next problem in Tb87

  • opening documentation / content URLS / websites in a tab fails. THis is due to a change in contentTabs, which now requires a uri attribute to be passed instead of a contentPage attribute.

The patched version simply passes both so it remains backwards compatible with Tb78, too:
QuickFolders-wx-5.4pre18.zip

@RealRaven2000
Copy link
Owner Author

RealRaven2000 commented Mar 3, 2021

Next problem in Tb87

  • advanced tab-specific properties was malformed because of lacking grid support:
    image
    these elements should be aligned vertically.

Fixed version:
QuickFolders-wx-5.4pre23.zip

@RealRaven2000
Copy link
Owner Author

I published Release 5.4 on ATN today

  • Fixed: Support Pages did not open anymore as content Tabs have a different parameter set.
  • Fixed: layout of advanced tab properties broken due to deprecated grid element.
  • Fixed: Copy / Move folders uses new MailServices.copy object

@aprojanos71
Copy link

Super!
But what is ATN?

@RealRaven2000
Copy link
Owner Author

Super!
But what is ATN?

an initialism for addons.thunderbird.net - where I release all my updates that are automatically deployed to my users. It used to be AMO (addons.mozilla.org).

@RealRaven2000 RealRaven2000 changed the title Make QuickFolders compatible with Thunderbird beta 87.0b1 Make QuickFolders compatible with Thunderbird beta 88.0b1 Mar 27, 2021
@RealRaven2000
Copy link
Owner Author

RealRaven2000 commented Mar 28, 2021

Here is a test version for Thunderbird 88:
QuickFolders-wx-5.4.2pre23.zip

(install by downloading the zip wilfe and then dragging it into Thudnerbird Add-ons Manager)

I hope addons.thunderbird.net will support uploading something with max-version number 8.0 so that all betas can be accepted.

@RealRaven2000
Copy link
Owner Author

RealRaven2000 commented Apr 17, 2021

To do: create list of changes for @jobisoft to document what's changing in Thunderbird ESR 2021/22

e.g. util.moveMessages() function uses nsIMsgCopyService.CopyMessages() which expects Array instead of nsIMutableArray

  let isListArray = util.versionGreaterOrEqual(util.ApplicationVersion, "85"); 
  if (isListArray) 
    messageList.push(Message);
  else
    messageList.appendElement(Message , false);
  let cs = Components.classes["@mozilla.org/messenger/messagecopyservice;1"].getService(Ci.nsIMsgCopyService);
  cs.CopyMessages(sourceFolder, messageList, targetFolder, isMove, QuickFolders.CopyListener, mw, true);

nsIMsgFolder.subfolders has changed from nsIMutableArray - see QuickFolders.Interface.addSubFoldersPopup() on how to wrap this code to get a clean array:

if (folder.hasSubFolders) {
  let subfolders;
  if (folder.subFolders.hasMoreElements) {
    // Tb78 and older - uses nsIMutableArray
    subfolders = [];
    var subFolders = folder.subFolders;
    while (subFolders.hasMoreElements()) {
      let sf = subFolders.getNext().QueryInterface(Ci.nsIMsgFolder);
      subfolders.push(sf);          
    }
  }      
  else
    subfolders = folder.subFolders; // Tb 87
}

Folder View Row Items - in this example QuickFolders.Util.generateMRUlist() creates a MRU list (history) based on folder timestamps (recent is a sorted Array of folders ):

for (let f of recent) { 
  if (typeof ftvItem == "function") 
    items.push(new ftvItem(f)); // Tb78 and older
  else
    items.push(new FtvItem(f));
};

Copying folders: this should go through MailServices instead of nsIMsgCopyService as the CopyFolders() function was removed:

  let cs = Cc["@mozilla.org/messenger/messagecopyservice;1"].getService(Ci.nsIMsgCopyService),
      array = toXPCOMArray(folders, Ci.nsIMutableArray); // Tb 78
  if (cs.CopyFolders)
    cs.CopyFolders(array, targetFolder, isMove, listener, msgWindow); // msgWindow  - global
  else { // Tb 88
    var { MailServices } = ChromeUtils.import("resource:///modules/MailServices.jsm");
    MailServices.copy.copyFolders(folders, targetFolder, isMove, listener, null);
  }

nsIMsgFolder.markMessagesRead() expects Array<nsIMsgDBHdr> instead of nsIArray as first parameter (this is from a FolderListener event that automatically marks mails as read as special feature for folders configured as such - see QuickFolders.FolderListener.OnItemAdded) - I just wrote this part and need to test it yet. "parentFolder" is the 1st and "item" is the 2nd parameter of the handler function:

  let messageList;
  if (util.versionGreaterOrEqual(util.ApplicationVersion, "85")) {
    messageList = [item];
  }
  else {
    messageList = Components.classes["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
    messageList.appendElement(item , false);
  }
  parentFolder.markMessagesRead(messageList, false);

@RealRaven2000 RealRaven2000 changed the title Make QuickFolders compatible with Thunderbird beta 88.0b1 Make QuickFolders compatible with Thunderbird beta 90.+ (ESR 2021/22) Apr 17, 2021
@RealRaven2000
Copy link
Owner Author

To Do: revisit QuickFolders.Util.allFoldersIterator - it may be possible to simplify this in a manner that is backwards compatible with Thundebird 78. at the moment it creates a nsIMutableArray, which may already be unnecessary within Thunderbird 78!

@jobisoft
Copy link
Collaborator

The reported changes have been added to DTN (I missed ftvItem).

Thanks!

@RealRaven2000 RealRaven2000 changed the title Make QuickFolders compatible with Thunderbird beta 90.+ (ESR 2021/22) Make QuickFolders compatible with Thunderbird beta 91.+ (ESR 2021/22) Jul 23, 2021
@RealRaven2000 RealRaven2000 changed the title Make QuickFolders compatible with Thunderbird beta 91.+ (ESR 2021/22) Make QuickFolders compatible with Thunderbird 91. (ESR 2021/22) Jul 23, 2021
@RealRaven2000
Copy link
Owner Author

Open items:

@RealRaven2000
Copy link
Owner Author

Latest test version for Thunderbird 91 (tested in Tb daily 92.0a1):

QuickFolders-mx-5.7pre64.zip

To install this preview, download the zip file and drag it into Thunderbird Add-ons manager.

@RealRaven2000
Copy link
Owner Author

  • Caused by deprecation of "fixIterator" the quickMove / quickJump functions stopped working. Here is a fixer version using normal Arrays tested in Thunderbird daily 92.0a1 64bit.

QuickFolders-mx-5.7pre106.zip

@RealRaven2000
Copy link
Owner Author

  • Fixed the missing (and badly styled) [Buy License] button at the bottom of the options dialog. This was already a problem since Tb78. Apparently it is part of a "shadow DOM" which ignores the style sheets of the main dialog.
  • showing the debug settings (and other advanced settings) via a small window that filters "about:config" stopped working in Tb91. To test , right-click any of the quickMove / reading list / recent folders button checkboxes or the debug mode checkbox in the options window:

image

QuickFolders-mx-5.7pre120.zip

To install this preview, download the zip file and drag it into Thunderbird Add-ons manager.

@RealRaven2000
Copy link
Owner Author

Looks like MailServices.copy.CopyMessages was renamed to MailServices.copy.copyMessages : sigh.

Fresh preview with quick fix:

QuickFolders-mx-5.7pre174.zip

To install this preview, download the zip file and drag it into Thunderbird Add-ons manager. Caution: contains fresh code from issue #187 - so if you haven't got any license you're a bit of a guinea pig right now. Just ironing out the kinks...

@RealRaven2000
Copy link
Owner Author

Fixed: dragging the envelope from current folder toolbar (Navigation bar). The envelope icon represents the currently selectged emails and dragging it failed in Thunderbird 91

image

Test Version below:

QuickFolders-mx-5.7pre212.zip

@RealRaven2000
Copy link
Owner Author

Another drag + drop issue I found was: #190 - this involved being able to drag the mail icon on the Current Folder toolbar (center screen) in order to make for a very quick and easy drag operation to targets such as the "recent folders" toolbar button from a constant remembered screen location. The bug is addressed in this preview version:

QuickFolders-mx-5.7pre212.zip
To install this preview, download the zip file and drag it into Thunderbird Add-ons manager.

@RealRaven2000
Copy link
Owner Author

Implemented in 5.7 - released on 10/08/2021

@RealRaven2000 RealRaven2000 unpinned this issue Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants