tell thunderbird to show a specific message

95 views
Skip to first unread message

aurelien

unread,
Feb 13, 2008, 6:13:39 AM2/13/08
to
Hi,
i'm developping an extension for firefox and thunderbird that would
allow to open email links from firefox into thunderbird.

messages in thunderbird have different properties to identify
themselves:
URI : imap-message://b...@domain.name.com/INBOX#8044
messageKey : 8044
messageId : 66F3EE10-DBA7-4C4F...@domain.com

Is there a function to tell thunderbird to load a particular message
in the message pane ?
I tried to use SelectAndScrollToKey(messageKey) but it scrolls to
message within the current folder.

It would be even better if it could be done from the outside (looks
like google desktop knows how to do it). I played and looked at the
code behind the -remote argument of the command line but i wasn't able
to find a solution.

It would be helpfull if you some extension to look at. Or to tell me
if the only solution is to go through all the folder and messages to
test the id...

Thanks

Aurélien

aurelien

unread,
Feb 14, 2008, 11:43:41 AM2/14/08
to
On Feb 13, 12:13 pm, aurelien <aurelientab...@gmail.com> wrote:
> Hi,
> i'm developping an extension for firefox and thunderbird that would
> allow to open email links from firefox into thunderbird.
>
> messages in thunderbird have different properties to identify
> themselves:
> URI : imap-message://...@domain.name.com/INBOX#8044
> messageKey : 8044
> messageId : 66F3EE10-DBA7-4C4F-A663-C5D56EE06...@domain.com

>
> Is there a function to tell thunderbird to load a particular message
> in the message pane ?
> I tried to use SelectAndScrollToKey(messageKey) but it scrolls to
> message within the current folder.
>
> It would be even better if it could be done from the outside (looks
> like google desktop knows how to do it). I played and looked at the
> code behind the -remote argument of the command line but i wasn't able
> to find a solution.
>
> It would be helpfull if you some extension to look at. Or to tell me
> if the only solution is to go through all the folder and messages to
> test the id...
>
> Thanks
>
> Aurélien

By following the advices at http://kb.mozillazine.org/UserChrome.js/Mail
, I am now able to show the message i want in the message-pane given
its uri.

uri : imap-message://...@domain.name.com/INBOX#8044
messageKey : 8044

// Select the folder
with (document.getElementById("folderTree").view)
for (var i = 0; i < rowCount; ++i) with (getResourceAtIndex(i))
uri == Value? selection.select(i) : uri.indexOf(Value) == 0 && !
isContainerOpen(i)? toggleOpenState(i) : null

// scroll to the right message
SelectAndScrollToKey(messageKey);

However, the message uri doesn't stay the same if you move the message
into another folder.
So I guess the solution would be to identify the message by its
header.messageId property ?

Apple allows to click on links of type message://messageId that will
open in Mail.app.

Does anyone knows given the messageId what to call to display the
message in the message pane of Thunderbird ?

Aurélien

semta...@gmail.com

unread,
Feb 28, 2008, 7:29:08 AM2/28/08
to
On Feb 14, 4:43 pm, aurelien <aurelientab...@gmail.com> wrote:
> On Feb 13, 12:13 pm, aurelien <aurelientab...@gmail.com> wrote:
>
>
>
> > Hi,
> > i'm developping an extension for firefox and thunderbird that would
> > allow to open email links from firefox into thunderbird.
>
> > messages in thunderbird have different properties to identify
> > themselves:
> > URI : imap-message://...@domain.name.com/INBOX#8044
> > messageKey : 8044
> > messageId : 66F3EE10-DBA7-4C4F-A663-C5D56EE06...@domain.com
>
> > Is there a function to tell thunderbird to load a particular message
> > in the message pane ?
> > I tried to use SelectAndScrollToKey(messageKey) but it scrolls to
> > message within the current folder.
>
> > It would be even better if it could be done from the outside (looks
> > like google desktop knows how to do it). I played and looked at the
> > code behind the -remote argument of the command line but i wasn't able
> > to find a solution.
>
> > It would be helpfull if you some extension to look at. Or to tell me
> > if the only solution is to go through all the folder and messages to
> > test the id...
>
> > Thanks
>
> > Aurélien
>
> By following the advices athttp://kb.mozillazine.org/UserChrome.js/Mail

> , I am now able to show the message i want in the message-pane given
> its uri.
>
> uri : imap-message://...@domain.name.com/INBOX#8044
> messageKey : 8044
>
> // Select the folder
> with (document.getElementById("folderTree").view)
> for (var i = 0; i < rowCount; ++i) with (getResourceAtIndex(i))
> uri == Value? selection.select(i) : uri.indexOf(Value) == 0 && !
> isContainerOpen(i)? toggleOpenState(i) : null
>
> // scroll to the right message
> SelectAndScrollToKey(messageKey);
>
> However, the message uri doesn't stay the same if you move the message
> into another folder.
> So I guess the solution would be to identify the message by its
> header.messageId property ?
>
> Apple allows to click on links of type message://messageId that will
> open in Mail.app.
>
> Does anyone knows given the messageId what to call to display the
> message in the message pane of Thunderbird ?
>
> Aurélien


Take a look at http://www.xulplanet.com/references/xpcomref/ifaces/nsIMsgDatabase.html

nslMsgDatabase gives you access to msgHdrs by calling
getMsgHdrForMessageID

Dan.

Reply all
Reply to author
Forward
0 new messages