-
Notifications
You must be signed in to change notification settings - Fork 4
Description
This is maybe a little bit unusual (or an edge case), and I'd actually be happy to do most of the code myself (and do a Pull Request), but I'm currently stuck (which I'll describe more about below). But first, a bit more on what I'm trying to achieve.
There are two (maybe more?) kinds of new mail windows that Thunderbird creates. One is the kind which ThunderLink currently initiates, which I've seen referred to as a standalone window in Thunderbird documentation. The other kind is what I call a "tabbed window" (or in Thunderbird documentation, a 3pane window). A tabbed or 3pane window includes the folder structure (usually on the left-hand side), but with the message being the selected tab.
Normally when you Open Message in New Window you get the standalone kind of window. But if you already have a message open in a tab and you select Move to New Window you will get a 3pane window instead. In general I have preferred the standalone format (it is cleaner in appearance). But I've found that there are some reasons I'd like to switch to using the 3pane window format instead (if it can be achieved relatively easily).
Here are some relevant bits of Thunderbird code:
replaceTabWithWindow:
https://mxr.mozilla.org/comm-central/source/mail/base/content/messenger.xul#231
https://mxr.mozilla.org/comm-central/source/mail/base/content/tabmail.xml#792
duplicateTabIn:
https://mxr.mozilla.org/comm-central/source/mozilla/browser/base/content/browser.js#7049
displayMessage (and related) helper functions:
https://mxr.mozilla.org/comm-central/source/mail/base/modules/MailUtils.js#98
Which is what Thunderlink uses:
https://github.com/poohsen/thunderlink/blob/master/components/thunderlinkCommandLineHandler.js#L117
My thinking is that I may be able to use one of the helper functions to do what I want:
https://mxr.mozilla.org/comm-central/source/mail/base/modules/MailUtils.js
And I suspect the key may be in sending something for the optional variable aViewWrapperToClone which is in several of these functions. Where I'm stuck is that I don't yet comprehend how or what to pass for that variable in order to tell Thunderbird I want a 3pane window. For example, once I know what to pass in, the following addition to Thunderlink (along related code) may achieve my goal: MailUtils.openMessagesInNewWindows([msgHdr], aViewWrapperToClone_ToGet3PaneWindow);.
So if anyone knows what I need to pass in for that variable aViewWrapperToClone in order to indicate I want to clone a 3pane view, that would be super helpful! Then I can likely do the rest on my own (hopefully) and submit a pull request to merge in the addition (for others benefit).
Thanks in advance to any who offer help! :)
Sean