Opening message in Thunderbird default message window, with message header

Hi,

I need to find a way to open a message in the default Thunderbird
message window. I only have the message header information, but to open
the message window i need the messageUri, folderUri and gDBView:

window.openDialog( "chrome://messenger/content/messageWindow.xul",
"_blank", "all,chrome,dialog=no,status,toolbar", messageUri, folderUri,
gDBView );

Is there any other way to open the message window, or how can I get
these arguments with just the header information? Trouble is, I'm not in 
the main thunderbird view when calling my function, so also the gDBView 
might be trouble.

I was wondering if there was a way to go around this by implementing 
some kind of method to select the message in question in the TB main 
view, and then open the message window. Then all those value would be 
easy to get.


0
Teemu
4/24/2009 11:58:08 PM
mozilla.dev.extensions 5694 articles. 0 followers. Post Follow

9 Replies
1907 Views

Similar Articles

[PageSpeed] 0
Get it on Google Play
Get it on Apple App Store

Teemu Hautala wrote:
> Hi,
> 
> I need to find a way to open a message in the default Thunderbird
> message window. I only have the message header information, but to open
> the message window i need the messageUri, folderUri and gDBView:
> 
> window.openDialog( "chrome://messenger/content/messageWindow.xul",
> "_blank", "all,chrome,dialog=no,status,toolbar", messageUri, folderUri,
> gDBView );
> 
> Is there any other way to open the message window, or how can I get
> these arguments with just the header information? Trouble is, I'm not in 
> the main thunderbird view when calling my function, so also the gDBView 
> might be trouble.
> 
> I was wondering if there was a way to go around this by implementing 
> some kind of method to select the message in question in the TB main 
> view, and then open the message window. Then all those value would be 
> easy to get.
> 

Actually I also have some trouble getting the message header... 
currently I get some chosen data from the message header and store it 
into a file. I was thinking that I would be able to use just the 
messageId to get the whole header, but now seems that even that isn't so 
easy. I managed to pass the gDBView to my extension window, but haven't 
yet been able to do much with it. At this point I don't know if it's 
even usable (I just passed it as an argument in window.opendialog(..)).

0
Teemu
4/25/2009 12:29:05 AM
 [25.04.2009 02:29]    �Teemu Hautala� wrote:
> Teemu Hautala wrote:
>> Hi,
>>
>> I need to find a way to open a message in the default Thunderbird
>> message window. I only have the message header information, but to open
>> the message window i need the messageUri, folderUri and gDBView:
>>
>> window.openDialog( "chrome://messenger/content/messageWindow.xul",
>> "_blank", "all,chrome,dialog=no,status,toolbar", messageUri, folderUri,
>> gDBView );
>>
>> Is there any other way to open the message window, or how can I get
>> these arguments with just the header information? Trouble is, I'm not 
>> in the main thunderbird view when calling my function, so also the 
>> gDBView might be trouble.
>>
>> I was wondering if there was a way to go around this by implementing 
>> some kind of method to select the message in question in the TB main 
>> view, and then open the message window. Then all those value would be 
>> easy to get.
>>
>
> Actually I also have some trouble getting the message header... 
> currently I get some chosen data from the message header and store it 
> into a file. I was thinking that I would be able to use just the 
> messageId to get the whole header, but now seems that even that isn't 
> so easy. I managed to pass the gDBView to my extension window, but 
> haven't yet been able to do much with it. At this point I don't know 
> if it's even usable (I just passed it as an argument in 
> window.opendialog(..)).
>
Maybe you have a look at ReminderFox. We use some code originally 
developed by Markus Hossner. With ReminderFox we save the messageId with 
a reminder/event and have the possibility to open the message using an 
icon, also TB isn't running (when ReminderFox runs ontop of Firefox).
G�nter
0
gNeandr
4/25/2009 6:45:15 AM
On 04/24/2009 05:29 PM, Teemu Hautala wrote:
> Actually I also have some trouble getting the message header...
> currently I get some chosen data from the message header and store it
> into a file. I was thinking that I would be able to use just the
> messageId to get the whole header, but now seems that even that isn't so
> easy. I managed to pass the gDBView to my extension window, but haven't
> yet been able to do much with it. At this point I don't know if it's
> even usable (I just passed it as an argument in window.opendialog(..)).
>

If you have the message-id and know what folder the message is in, you 
can get the header from the database (which you get from the folder).

Example:
let msgHdr = folder.msgDatabase.getMsgHdrForMessageID(messageId);

where:
folder is an nsIMsgFolder

Andrew
0
Andrew
4/25/2009 6:49:28 AM
On 04/24/2009 04:58 PM, Teemu Hautala wrote:
> Hi,
>
> I need to find a way to open a message in the default Thunderbird
> message window. I only have the message header information, but to open
> the message window i need the messageUri, folderUri and gDBView:
>
> window.openDialog( "chrome://messenger/content/messageWindow.xul",
> "_blank", "all,chrome,dialog=no,status,toolbar", messageUri, folderUri,
> gDBView );
>
> Is there any other way to open the message window, or how can I get
> these arguments with just the header information? Trouble is, I'm not in
> the main thunderbird view when calling my function, so also the gDBView
> might be trouble.
>
> I was wondering if there was a way to go around this by implementing
> some kind of method to select the message in question in the TB main
> view, and then open the message window. Then all those value would be
> easy to get.
>
>

given an nsIMsgDBHdr msgHdr:

let messageUri = msgHdr.folder.getUriForMsg(msgHdr);
let folderUri = msgHdr.folder.URI;

I'm not looking at the code right now, but presumably what the argument 
wants is an nsIMsgDBView that currently has the message visible in it. 
Given a message header, you can get a folder, which you can use to 
instantiate a new db view on the folder.

Andrew
0
Andrew
4/25/2009 6:54:14 AM
Andrew Sutherland wrote:
> On 04/24/2009 04:58 PM, Teemu Hautala wrote:
>> Hi,
>>
>> I need to find a way to open a message in the default Thunderbird
>> message window. I only have the message header information, but to open
>> the message window i need the messageUri, folderUri and gDBView:
>>
>> window.openDialog( "chrome://messenger/content/messageWindow.xul",
>> "_blank", "all,chrome,dialog=no,status,toolbar", messageUri, folderUri,
>> gDBView );
>>
>> Is there any other way to open the message window, or how can I get
>> these arguments with just the header information? Trouble is, I'm not in
>> the main thunderbird view when calling my function, so also the gDBView
>> might be trouble.
>>
>> I was wondering if there was a way to go around this by implementing
>> some kind of method to select the message in question in the TB main
>> view, and then open the message window. Then all those value would be
>> easy to get.
>>
>>
> 
> given an nsIMsgDBHdr msgHdr:
> 
> let messageUri = msgHdr.folder.getUriForMsg(msgHdr);
> let folderUri = msgHdr.folder.URI;
> 
> I'm not looking at the code right now, but presumably what the argument 
> wants is an nsIMsgDBView that currently has the message visible in it. 
> Given a message header, you can get a folder, which you can use to 
> instantiate a new db view on the folder.
> 
> Andrew
> 

Thanks, I'll try these things tonight. Though right now I'm bit
uncertain how to get the URI of the message folder, which I guess I'll
need to get the nsIMsgFolder. There's a method for  getting the URI of a
message through the nsIMsgFolder, but couldn't find  a similar method
for folder. The URI's seem very similar though, so maybe I can do some 
tricks with the strings to get the folder URI.

Also there might be a problem with this, because when I get the
nsIMsgDBHdr, the folder can be changed later by other functionality of
my extension (and by user). I guess I have to somehow figure out of 
updating the folder data I have if this happens, or then find out how I 
could search through all the folders visible for thunderbird, with just 
the messageId at hand.

DB views are still quite unfamiliar for me. Is there any short guide of
how to use them available? Or rather, how to manipulate the thread pane
in Thunderbird through them. I'll try to get my head wrappend around the
docs in MDC, but so far they have been be bit unrevealing.

I'm hoping to have a beta version of my extension out somewhere next
week. Doing it as a one-man project work for my school. Seems this
project became bit bigger than I thought it would.



0
Teemu
4/25/2009 4:05:18 PM
 [25.04.2009 18:05]    �Teemu Hautala� wrote:
> Andrew Sutherland wrote:
>> On 04/24/2009 04:58 PM, Teemu Hautala wrote:
>>> Hi,
>>>
>>> I need to find a way to open a message in the default Thunderbird
>>> message window. I only have the message header information, but to open
>>> the message window i need the messageUri, folderUri and gDBView:
>>>
>>> window.openDialog( "chrome://messenger/content/messageWindow.xul",
>>> "_blank", "all,chrome,dialog=no,status,toolbar", messageUri, folderUri,
>>> gDBView );
>>>
>>> Is there any other way to open the message window, or how can I get
>>> these arguments with just the header information? Trouble is, I'm 
>>> not in
>>> the main thunderbird view when calling my function, so also the gDBView
>>> might be trouble.
>>>
>>> I was wondering if there was a way to go around this by implementing
>>> some kind of method to select the message in question in the TB main
>>> view, and then open the message window. Then all those value would be
>>> easy to get.
>>>
>>>
>>
>> given an nsIMsgDBHdr msgHdr:
>>
>> let messageUri = msgHdr.folder.getUriForMsg(msgHdr);
>> let folderUri = msgHdr.folder.URI;
>>
>> I'm not looking at the code right now, but presumably what the 
>> argument wants is an nsIMsgDBView that currently has the message 
>> visible in it. Given a message header, you can get a folder, which 
>> you can use to instantiate a new db view on the folder.
>>
>> Andrew
>>
>
> Thanks, I'll try these things tonight. Though right now I'm bit
> uncertain how to get the URI of the message folder, which I guess I'll
> need to get the nsIMsgFolder. There's a method for  getting the URI of a
> message through the nsIMsgFolder, but couldn't find  a similar method
> for folder. The URI's seem very similar though, so maybe I can do some 
> tricks with the strings to get the folder URI.
>
> Also there might be a problem with this, because when I get the
> nsIMsgDBHdr, the folder can be changed later by other functionality of
> my extension (and by user). I guess I have to somehow figure out of 
> updating the folder data I have if this happens, or then find out how 
> I could search through all the folders visible for thunderbird, with 
> just the messageId at hand.
>
> DB views are still quite unfamiliar for me. Is there any short guide of
> how to use them available? Or rather, how to manipulate the thread pane
> in Thunderbird through them. I'll try to get my head wrappend around the
> docs in MDC, but so far they have been be bit unrevealing.
>
> I'm hoping to have a beta version of my extension out somewhere next
> week. Doing it as a one-man project work for my school. Seems this
> project became bit bigger than I thought it would.
>
>
>
Just to motivate you to look into ReminderFox for the use of 
'messageID'. We have had similar situation/problems and we find the 
message also the message is moved along the folders. Markus did a great 
job with his code!!
Dont hesitate to call back if you need details or directions ...
0
gNeandr
4/25/2009 5:47:24 PM
gNeandr wrote:


>>
> Just to motivate you to look into ReminderFox for the use of 
> 'messageID'. We have had similar situation/problems and we find the 
> message also the message is moved along the folders. Markus did a great 
> job with his code!!
> Dont hesitate to call back if you need details or directions ...
> 

Thanks! Seems that there is lot of things in ReminderFox which can help 
me. The way to get all the folder URI's to search seems quite 
complicated though... trying to understand how it all works. Though I 
guess trying to update my database on folder listeners events wouldn't 
really work anyway, if the user makes changes somewhere else.

0
Teemu
4/25/2009 6:50:13 PM
Teemu Hautala wrote:
> gNeandr wrote:
> 
> 
>>>
>> Just to motivate you to look into ReminderFox for the use of 
>> 'messageID'. We have had similar situation/problems and we find the 
>> message also the message is moved along the folders. Markus did a 
>> great job with his code!!
>> Dont hesitate to call back if you need details or directions ...
>>
> 
> Thanks! Seems that there is lot of things in ReminderFox which can help 
> me. The way to get all the folder URI's to search seems quite 
> complicated though... trying to understand how it all works. Though I 
> guess trying to update my database on folder listeners events wouldn't 
> really work anyway, if the user makes changes somewhere else.
> 
> 

Got my extension to work in the same way as ReminderFox, by searching
with the messageId. That's quite a bit of code for something that I
thought would be pretty simple. Thanks a lot, I couldn't have done that
by myself in the time I have left to finish this project.

Now however I have another issue... I would need to get the Inbox of
each of the accounts, separated from the other folders. I've managed to 
parse the main folders in each account, but now I'm wondering, is Inbox 
always named as "Inbox" in TB? For now, I will assume it is and carry on.

I need to trust this item also because I have a folder listener, which I 
want to limit only to Inbox and Sent folders of each account. It's bit 
strange though, because I've noticed on my testing that sometimes I get 
a duplicate event in "INBOX", in addition to "Inbox" event.

But thanks for the help, right now I'm going forward again.

0
Teemu
4/26/2009 8:10:15 PM
Teemu Hautala wrote:

> I would need to get the Inbox of each of the accounts, separated from 
> the other folders.

That's easy in TB3, just call getFolderWithFlag(nsMsgFolderFlags.Inbox); 
on each account's root folder.

-- 
Warning: May contain traces of nuts.
0
Neil
4/27/2009 11:22:31 AM
Reply:

Similar Artilces:

odd behavior: message hunting on deletion in a folder
Name: Chris Carter Email: carter_at_q7.com Product: Thunderbird Summary: odd behavior: message hunting on deletion in a folder - annoyance: message window closure auto-opens next message Comments: odd behavior: When in a mail folder deleting individual messages, the highlight always moves to the next message below the deleted message in the display regardless of whether the contents of the folder are sorted in ascending or descending order. It strikes me as more sensible to have the highlight shift be sensitive to the sort order so that the highlight always shifts to the next...

superreview granted: [Bug 290057] Thunderbird should integrate with the Spotlight Search : [Attachment 247745] open messages from spotlight results in stand-alone message window
Scott MacGregor <mscott@mozilla.org> has granted David Bienvenu <bienvenu@nventure.com>'s request for superreview: Bug 290057: Thunderbird should integrate with the Spotlight Search https://bugzilla.mozilla.org/show_bug.cgi?id=290057 Attachment 247745: open messages from spotlight results in stand-alone message window https://bugzilla.mozilla.org/attachment.cgi?id=247745&action=edit ------- Additional Comments from Scott MacGregor <mscott@mozilla.org> - rv = OpenMessengerWindowWithUri("mail:3pane", folderUri.get(), msgKey); + rv = OpenMesse...

superreview requested: [Bug 290057] Thunderbird should integrate with the Spotlight Search : [Attachment 247745] open messages from spotlight results in stand-alone message window
David Bienvenu <bienvenu@nventure.com> has asked Scott MacGregor <mscott@mozilla.org> for superreview: Bug 290057: Thunderbird should integrate with the Spotlight Search https://bugzilla.mozilla.org/show_bug.cgi?id=290057 Attachment 247745: open messages from spotlight results in stand-alone message window https://bugzilla.mozilla.org/attachment.cgi?id=247745&action=edit ------- Additional Comments from David Bienvenu <bienvenu@nventure.com> this wasn't nearly as easy as I thought - we were ignoring the window type, so I had to add some code to pay attent...

Double Click on Inbox Messages Opens Compose Window for Message
Why does the compose window automatically open up for messages in the Inbox folder when I double click on them? Maybe Thunderbird is supposed to act this way but, when I double click e-mail in any other mail application the e-mail opens up in a new window. All e-mail messages in other folders in Thunderbird open up in a new window except for the Inbox. I'm using Thunderbird version 1.5 (20051201) but I have had the same problem with the other versions I used prior to this version. Any Ideas? I have the options set to open new messages in a new message window but it does...

Unable to Open New Messages or Send Messages in Windows 98
Hi there and thanks for any help in advance. The volunteers in this forum are wonderful! I have two windows 98 machines that are having an issue with Groupwise 6.5.7. Every time on of them tries to open a message, they get a pop up about setting up Windows Messaging. I have never seen that happen before. We have the Groupwise client on several 98 machines and have never had this issue occur. Has anyone heard of this or have any suggestions for me? Thanks in advance! Jami Benson Jamie, It appears that in the past few days you have not received a response to your posting. Th...

superreview granted: [Bug 239226] Opening Forward Message Attachment Opens parent message in a new window : [Attachment 145295] the fix
David Bienvenu <bienvenu@nventure.com> has granted Scott MacGregor <mscott@mozilla.org>'s request for superreview: Bug 239226: Opening Forward Message Attachment Opens parent message in a new window http://bugzilla.mozilla.org/show_bug.cgi?id=239226 Attachment 145295: the fix http://bugzilla.mozilla.org/attachment.cgi?id=145295&action=edit ------- Additional Comments from David Bienvenu <bienvenu@nventure.com> ok with me if it's ok with Darin. ...

superreview requested: [Bug 239226] Opening Forward Message Attachment Opens parent message in a new window : [Attachment 145295] the fix
Scott MacGregor <mscott@mozilla.org> has asked David Bienvenu <bienvenu@nventure.com> for superreview: Bug 239226: Opening Forward Message Attachment Opens parent message in a new window http://bugzilla.mozilla.org/show_bug.cgi?id=239226 Attachment 145295: the fix http://bugzilla.mozilla.org/attachment.cgi?id=145295&action=edit ------- Additional Comments from Scott MacGregor <mscott@mozilla.org> asking Darin for the r=. This was a regression caused by the string defragmentation landing. The code in question was causing the url spec for the underlying nsIUR...

Unable to Open New Messages or Send Messages in Windows 98 #2
Hi there and thanks for any help in advance. The volunteers in this forum are wonderful! I have two windows 98 machines that are having an issue with Groupwise 6.5.7. Every time on of them tries to open a message, they get a pop up about setting up Windows Messaging. I have never seen that happen before. We have the Groupwise client on several 98 machines and have never had this issue occur. Has anyone heard of this or have any suggestions for me? Thanks in advance! Jami Benson --____ARXGHFEHFIAEDGOEQEPQ____ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: b...

Double Click on Inbox Messages Opens Compose Window for Message #2
Why does the compose window automatically open up for messages in the Inbox folder when I double click on them? Maybe Thunderbird is supposed to act this way but, when I double click e-mail in any other mail application the e-mail opens up in a new window. All e-mail messages in other folders in Thunderbird open up in a new window except for the Inbox. I'm using Thunderbird version 1.5 (20051201) but I have had the same problem with the other versions I used prior to this version. Any Ideas? I have the options set to open new messages in a new message window but it do...

superreview granted: [Bug 37712] "Receiving: message headers" should be "Downloading message headers 123 of 1323" : [Attachment 176781] patch for thunderbird
Scott MacGregor <mscott@mozilla.org> has granted Tim Meader <tmeader@gmail.com>'s request for superreview: Bug 37712: "Receiving: message headers" should be "Downloading message headers 123 of 1323" https://bugzilla.mozilla.org/show_bug.cgi?id=37712 Attachment 176781: patch for thunderbird https://bugzilla.mozilla.org/attachment.cgi?id=176781&action=edit ------- Additional Comments from Scott MacGregor <mscott@mozilla.org> I changed my mind. I'm ok with this now. ...

superreview requested: [Bug 37712] "Receiving: message headers" should be "Downloading message headers 123 of 1323" : [Attachment 176781] patch for thunderbird
Tim Meader <tmeader@gmail.com> has asked Scott MacGregor <mscott@mozilla.org> for superreview: Bug 37712: "Receiving: message headers" should be "Downloading message headers 123 of 1323" https://bugzilla.mozilla.org/show_bug.cgi?id=37712 Attachment 176781: patch for thunderbird https://bugzilla.mozilla.org/attachment.cgi?id=176781&action=edit ------- Additional Comments from Tim Meader <tmeader@gmail.com> Analogous patch for Thunderbird, to keep them in sync. ...

Message filtering on ALL messages?
A number of news SERVERS have been infiltrated by spammers and send the same garbage message to every NG on that server. it is possible to use: Message->Create_a_filter_from_message... to block a sender to a specific NG. If there are a bunch of NGs, that same process has to be repeated for each NG to block one sender. Is there a way to perform this process, or set up a single filter for every NG on that server? [Obviously, I hope, when I say 'every' I mean every NG that I am subscribed to, or may subscribe to later; not every subscription on the server.] TI...

New message message
Why does ThunderBird say there are no new messages before it downloads the new messages? JimL --- The ONLY thing wrong with our economy is the hundreds of crooked CEO's running it. inkleputDEL@ETEisp.com on 9/21/2008 3:53 PM, keyboarded a reply: > Why does ThunderBird say there are no new messages before it downloads the > new messages? > > JimL > > --- > The ONLY thing wrong with our economy is the hundreds of crooked CEO's running it. I take it that your referring to News accounts. There are some minor issues that are bing addressed on t...

Using Message Headers for Message Filtering
I am using TB 11.0.1 on Windows XP SP3. I am successfully filtering e-mail and newsgroup messages (tagging, deleting or sorting to folders) using the Headers:- Subject, From, To and Message-ID, but I am unable to use "Path". I am able to "create" a Path header using the customise process, just as I "created" a Message-ID header, but the created "Path" does not function in the filter although showing in mailnews.customHeaders! -- Regards Jim Wood, Brisbane Jim Wood wrote: > I am using TB 11.0.1 on Windows XP SP3. > > I am...

Web resources about - Opening message in Thunderbird default message window, with message header - mozilla.dev.extensions

Mozilla Thunderbird
Mozilla Thunderbird is created by a global non-profit dedicated to putting individuals in control and shaping the future of the web for the public ...

Thunderbirds Are Go - Wikipedia, the free encyclopedia
Thunderbirds Are Go is a 1966 British science-fiction film based on Thunderbirds , a 1960s television series starring marionette puppets and ...

Edit - Thunderbird - CrunchBase Product Profile
TechCrunch CrunchBase More TechCrunch Europe TechCrunch France TechCrunch Japan Register - Login or Advanced Search Home > Products > Thunderbird ...

F-16C Thunderbirds Formation - Flickr - Photo Sharing!
USAF Thunderbirds at the 2008 Battle Creek Air Show

Thunderbirds Are Go - Introducing The World - YouTube
The world of Thunderbirds Are Go, Tracy Island, miniature sets and craft have been lovingly made by none other than WETA Workshop - the model ...

Thunderbirds are go: First pictures of TV remake
The first images of the upcoming TV reboot of the iconic series Thunderbirds have been released, recasting the iconic puppets from the 1960s ...

Thunderbirds creator Gerry Anderson dies aged 83
... puppet TV shows Captain Scarlet, Stingray and Joe 90 died in his sleep, his son announces. Gerry Anderson, best known as the creator of Thunderbirds ...

Firebirds hold nerve to hold out Thunderbirds
It was another close shave but Queensland Firebirds coach Roselee Jencke was happy for her side to take a second straight win.

Thunderbirds are go, puppets are gone
Human Thunderbirds? What does this mean, writes James Cockington. - The Age Online

Southerners steal last-gasp draw against Thunderbirds
Southern Steel stole a 53-53 draw in the chaotic final seconds of their trans-Tasman netball league clash against Adelaide Thunderbirds.

Resources last updated: 12/6/2015 2:09:51 PM