Adding A Custom Column When Unified Folders are in Use?

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding A Custom Column When Unified Folders are in Use?

whitedavidp
I just wrote an addon that adds a custom column to TB's thread pane. It
seems to work just fine until I turn on Unified Folders. When I do this,
the entire column contains blank entries and the error console shows a
pile of the following:

Error: uncaught exception: [Exception... "Component returned failure
code: 0x80004003 (NS_ERROR_INVALID_POINTER)
[nsIMsgDatabase.GetMsgHdrForKey]"  nsresult: "0x80004003
(NS_ERROR_INVALID_POINTER)"  location: "JS frame ::
chrome://usebccinstead/content/extendedRecipientsColumn.js ::
<TOP_LEVEL> :: line 21"  data: no]

The code in question is in the column handler's getCellText() method and
is doing the following:

     // get the message's header so that we can extract the TO, CC,
and    // BCC fields
     var key = gDBView.getKeyAt(row);
     var hdr = gDBView.db.GetMsgHdrForKey(key);

Any suggestions on what I need to do differently?

Thanks
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Adding A Custom Column When Unified Folders are in Use?

whitedavidp
Answered my own question. Instead of the code below, use this:

     // get the message's header so that we can extract the TO, CC,
and    // BCC fields
     var key = gDBView.getKeyAt(row);

     // the following is needed in case we are dealing with a "unified"
                                                              // view
     var folder = gDBView.getFolderForViewIndex(row);

     // while msgDatabase is not in the docs, it is there - really!
     var hdr = folder.msgDatabase.GetMsgHdrForKey(key);

Thanks

[hidden email] wrote:

> I just wrote an addon that adds a custom column to TB's thread pane. It
> seems to work just fine until I turn on Unified Folders. When I do this,
> the entire column contains blank entries and the error console shows a
> pile of the following:
>
> Error: uncaught exception: [Exception... "Component returned failure
> code: 0x80004003 (NS_ERROR_INVALID_POINTER)
> [nsIMsgDatabase.GetMsgHdrForKey]"  nsresult: "0x80004003
> (NS_ERROR_INVALID_POINTER)"  location: "JS frame ::
> chrome://usebccinstead/content/extendedRecipientsColumn.js ::
> <TOP_LEVEL> :: line 21"  data: no]
>
> The code in question is in the column handler's getCellText() method and
> is doing the following:
>
>     // get the message's header so that we can extract the TO, CC,
> and             // BCC fields
>     var key = gDBView.getKeyAt(row);
>     var hdr = gDBView.db.GetMsgHdrForKey(key);
>
> Any suggestions on what I need to do differently?
>
> Thanks
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Adding A Custom Column When Unified Folders are in Use?

David Bienvenu
Or, var hdr = gDBView.getMsgHdrAt(row);

- David

On 2/10/2012 3:17 PM, [hidden email] wrote:

> Answered my own question. Instead of the code below, use this:
>
>     // get the message's header so that we can extract the TO, CC, and             // BCC fields
>     var key = gDBView.getKeyAt(row);
>
>     // the following is needed in case we are dealing with a "unified"                                                              // view
>     var folder = gDBView.getFolderForViewIndex(row);
>
>     // while msgDatabase is not in the docs, it is there - really!
>     var hdr = folder.msgDatabase.GetMsgHdrForKey(key);
>
> Thanks
>
> [hidden email] wrote:
>> I just wrote an addon that adds a custom column to TB's thread pane. It seems to work just fine until I turn on Unified Folders. When I do this, the entire column
>> contains blank entries and the error console shows a pile of the following:
>>
>> Error: uncaught exception: [Exception... "Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIMsgDatabase.GetMsgHdrForKey]"  nsresult: "0x80004003
>> (NS_ERROR_INVALID_POINTER)"  location: "JS frame :: chrome://usebccinstead/content/extendedRecipientsColumn.js :: <TOP_LEVEL> :: line 21"  data: no]
>>
>> The code in question is in the column handler's getCellText() method and is doing the following:
>>
>>     // get the message's header so that we can extract the TO, CC, and             // BCC fields
>>     var key = gDBView.getKeyAt(row);
>>     var hdr = gDBView.db.GetMsgHdrForKey(key);
>>
>> Any suggestions on what I need to do differently?
>>
>> Thanks

_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Adding A Custom Column When Unified Folders are in Use?

whitedavidp
Thanks David,

I checked here
<https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIMsgDBView>
and do not see that method documented. Do you know what version of TB it
was introduced? I am presuming that the methods I am calling have been
there from at least TB 3 but I have no installed version 3 with which to
test.

David Bienvenu wrote:

> Or, var hdr = gDBView.getMsgHdrAt(row);
>
> - David
>
> On 2/10/2012 3:17 PM, [hidden email] wrote:
>> Answered my own question. Instead of the code below, use this:
>>
>>     // get the message's header so that we can extract the TO, CC,
>> and             // BCC fields
>>     var key = gDBView.getKeyAt(row);
>>
>>     // the following is needed in case we are dealing with a
>> "unified"                                                              
>> // view
>>     var folder = gDBView.getFolderForViewIndex(row);
>>
>>     // while msgDatabase is not in the docs, it is there - really!
>>     var hdr = folder.msgDatabase.GetMsgHdrForKey(key);
>>
>> Thanks
>>
>> [hidden email] wrote:
>>> I just wrote an addon that adds a custom column to TB's thread pane.
>>> It seems to work just fine until I turn on Unified Folders. When I do
>>> this, the entire column contains blank entries and the error console
>>> shows a pile of the following:
>>>
>>> Error: uncaught exception: [Exception... "Component returned failure
>>> code: 0x80004003 (NS_ERROR_INVALID_POINTER)
>>> [nsIMsgDatabase.GetMsgHdrForKey]"  nsresult: "0x80004003
>>> (NS_ERROR_INVALID_POINTER)"  location: "JS frame ::
>>> chrome://usebccinstead/content/extendedRecipientsColumn.js ::
>>> <TOP_LEVEL> :: line 21"  data: no]
>>>
>>> The code in question is in the column handler's getCellText() method
>>> and is doing the following:
>>>
>>>     // get the message's header so that we can extract the TO, CC,
>>> and             // BCC fields
>>>     var key = gDBView.getKeyAt(row);
>>>     var hdr = gDBView.db.GetMsgHdrForKey(key);
>>>
>>> Any suggestions on what I need to do differently?
>>>
>>> Thanks
>
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Adding A Custom Column When Unified Folders are in Use?

whitedavidp
In reply to this post by whitedavidp
And I did update the tutorial on this subject here
<https://developer.mozilla.org/en/Extensions/Thunderbird/Creating_a_Custom_Column>.
However, I did not use David's suggestion as I did not know it at the
time nor do I know when the getMsgHdrAt() method was introduced.

[hidden email] wrote:

> Answered my own question. Instead of the code below, use this:
>
>     // get the message's header so that we can extract the TO, CC,
> and             // BCC fields
>     var key = gDBView.getKeyAt(row);
>
>     // the following is needed in case we are dealing with a "unified"
>                                                              // view
>     var folder = gDBView.getFolderForViewIndex(row);
>
>     // while msgDatabase is not in the docs, it is there - really!
>     var hdr = folder.msgDatabase.GetMsgHdrForKey(key);
>
> Thanks
>
> [hidden email] wrote:
>> I just wrote an addon that adds a custom column to TB's thread pane.
>> It seems to work just fine until I turn on Unified Folders. When I do
>> this, the entire column contains blank entries and the error console
>> shows a pile of the following:
>>
>> Error: uncaught exception: [Exception... "Component returned failure
>> code: 0x80004003 (NS_ERROR_INVALID_POINTER)
>> [nsIMsgDatabase.GetMsgHdrForKey]"  nsresult: "0x80004003
>> (NS_ERROR_INVALID_POINTER)"  location: "JS frame ::
>> chrome://usebccinstead/content/extendedRecipientsColumn.js ::
>> <TOP_LEVEL> :: line 21"  data: no]
>>
>> The code in question is in the column handler's getCellText() method
>> and is doing the following:
>>
>>     // get the message's header so that we can extract the TO, CC,
>> and             // BCC fields
>>     var key = gDBView.getKeyAt(row);
>>     var hdr = gDBView.db.GetMsgHdrForKey(key);
>>
>> Any suggestions on what I need to do differently?
>>
>> Thanks
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Adding A Custom Column When Unified Folders are in Use?

Jonathan Protzenko
I usually advise against reading MDN for Thunderbird IDL references.
nsIAbCard is wildly out of date, nsIMsgDBView is, as you saw, out of
date as well, and the same goes for nsIMsgDBHdr. Always refer to IDL
files in the tree.

Cheers,

jonathan

On Sat 11 Feb 2012 12:45:34 AM CET, [hidden email] wrote:

> And I did update the tutorial on this subject here
> <https://developer.mozilla.org/en/Extensions/Thunderbird/Creating_a_Custom_Column>.
> However, I did not use David's suggestion as I did not know it at the
> time nor do I know when the getMsgHdrAt() method was introduced.
>
> [hidden email] wrote:
>> Answered my own question. Instead of the code below, use this:
>>
>> // get the message's header so that we can extract the TO, CC, and //
>> BCC fields
>> var key = gDBView.getKeyAt(row);
>>
>> // the following is needed in case we are dealing with a "unified" //
>> view
>> var folder = gDBView.getFolderForViewIndex(row);
>>
>> // while msgDatabase is not in the docs, it is there - really!
>> var hdr = folder.msgDatabase.GetMsgHdrForKey(key);
>>
>> Thanks
>>
>> [hidden email] wrote:
>>> I just wrote an addon that adds a custom column to TB's thread pane.
>>> It seems to work just fine until I turn on Unified Folders. When I
>>> do this, the entire column contains blank entries and the error
>>> console shows a pile of the following:
>>>
>>> Error: uncaught exception: [Exception... "Component returned failure
>>> code: 0x80004003 (NS_ERROR_INVALID_POINTER)
>>> [nsIMsgDatabase.GetMsgHdrForKey]" nsresult: "0x80004003
>>> (NS_ERROR_INVALID_POINTER)" location: "JS frame ::
>>> chrome://usebccinstead/content/extendedRecipientsColumn.js ::
>>> <TOP_LEVEL> :: line 21" data: no]
>>>
>>> The code in question is in the column handler's getCellText() method
>>> and is doing the following:
>>>
>>> // get the message's header so that we can extract the TO, CC, and
>>> // BCC fields
>>> var key = gDBView.getKeyAt(row);
>>> var hdr = gDBView.db.GetMsgHdrForKey(key);
>>>
>>> Any suggestions on what I need to do differently?
>>>
>>> Thanks
> _______________________________________________
> dev-apps-thunderbird mailing list
> [hidden email]
> https://lists.mozilla.org/listinfo/dev-apps-thunderbird
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Adding A Custom Column When Unified Folders are in Use?

David Bienvenu
In reply to this post by whitedavidp
I added it to the devmo page - it was in 3.0, so it's been available for a while. But the devmo doc is a bit out of date so the idl is really the most definitive source.

- David

On 2/10/2012 3:40 PM, [hidden email] wrote:

> Thanks David,
>
> I checked here <https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIMsgDBView> and do not see that method documented. Do you know what version of TB it was
> introduced? I am presuming that the methods I am calling have been there from at least TB 3 but I have no installed version 3 with which to test.
>
> David Bienvenu wrote:
>> Or, var hdr = gDBView.getMsgHdrAt(row);
>>
>> - David
>>
>> On 2/10/2012 3:17 PM, [hidden email] wrote:
>>> Answered my own question. Instead of the code below, use this:
>>>
>>>     // get the message's header so that we can extract the TO, CC, and             // BCC fields
>>>     var key = gDBView.getKeyAt(row);
>>>
>>>     // the following is needed in case we are dealing with a "unified"                                                              // view
>>>     var folder = gDBView.getFolderForViewIndex(row);
>>>
>>>     // while msgDatabase is not in the docs, it is there - really!
>>>     var hdr = folder.msgDatabase.GetMsgHdrForKey(key);
>>>
>>> Thanks
>>>
>>> [hidden email] wrote:
>>>> I just wrote an addon that adds a custom column to TB's thread pane. It seems to work just fine until I turn on Unified Folders. When I do this, the entire column
>>>> contains blank entries and the error console shows a pile of the following:
>>>>
>>>> Error: uncaught exception: [Exception... "Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIMsgDatabase.GetMsgHdrForKey]"  nsresult:
>>>> "0x80004003 (NS_ERROR_INVALID_POINTER)"  location: "JS frame :: chrome://usebccinstead/content/extendedRecipientsColumn.js :: <TOP_LEVEL> :: line 21"  data: no]
>>>>
>>>> The code in question is in the column handler's getCellText() method and is doing the following:
>>>>
>>>>     // get the message's header so that we can extract the TO, CC, and             // BCC fields
>>>>     var key = gDBView.getKeyAt(row);
>>>>     var hdr = gDBView.db.GetMsgHdrForKey(key);
>>>>
>>>> Any suggestions on what I need to do differently?
>>>>
>>>> Thanks
>>

_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Adding A Custom Column When Unified Folders are in Use?

whitedavidp
Thanks David,

Your technique works well. I will update my changes to the tutorial.

David

David Bienvenu wrote:

> I added it to the devmo page - it was in 3.0, so it's been available for
> a while. But the devmo doc is a bit out of date so the idl is really the
> most definitive source.
>
> - David
>
> On 2/10/2012 3:40 PM, [hidden email] wrote:
>> Thanks David,
>>
>> I checked here
>> <https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIMsgDBView>
>> and do not see that method documented. Do you know what version of TB
>> it was introduced? I am presuming that the methods I am calling have
>> been there from at least TB 3 but I have no installed version 3 with
>> which to test.
>>
>> David Bienvenu wrote:
>>> Or, var hdr = gDBView.getMsgHdrAt(row);
>>>
>>> - David
>>>
>>> On 2/10/2012 3:17 PM, [hidden email] wrote:
>>>> Answered my own question. Instead of the code below, use this:
>>>>
>>>>     // get the message's header so that we can extract the TO, CC,
>>>> and             // BCC fields
>>>>     var key = gDBView.getKeyAt(row);
>>>>
>>>>     // the following is needed in case we are dealing with a
>>>> "unified"                                                              
>>>> // view
>>>>     var folder = gDBView.getFolderForViewIndex(row);
>>>>
>>>>     // while msgDatabase is not in the docs, it is there - really!
>>>>     var hdr = folder.msgDatabase.GetMsgHdrForKey(key);
>>>>
>>>> Thanks
>>>>
>>>> [hidden email] wrote:
>>>>> I just wrote an addon that adds a custom column to TB's thread
>>>>> pane. It seems to work just fine until I turn on Unified Folders.
>>>>> When I do this, the entire column contains blank entries and the
>>>>> error console shows a pile of the following:
>>>>>
>>>>> Error: uncaught exception: [Exception... "Component returned
>>>>> failure code: 0x80004003 (NS_ERROR_INVALID_POINTER)
>>>>> [nsIMsgDatabase.GetMsgHdrForKey]"  nsresult: "0x80004003
>>>>> (NS_ERROR_INVALID_POINTER)"  location: "JS frame ::
>>>>> chrome://usebccinstead/content/extendedRecipientsColumn.js ::
>>>>> <TOP_LEVEL> :: line 21"  data: no]
>>>>>
>>>>> The code in question is in the column handler's getCellText()
>>>>> method and is doing the following:
>>>>>
>>>>>     // get the message's header so that we can extract the TO, CC,
>>>>> and             // BCC fields
>>>>>     var key = gDBView.getKeyAt(row);
>>>>>     var hdr = gDBView.db.GetMsgHdrForKey(key);
>>>>>
>>>>> Any suggestions on what I need to do differently?
>>>>>
>>>>> Thanks
>>>
>
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Getting at the BCC List in TB2?

whitedavidp
It seems that I get easy access to the BCC list from a message's header
in TB 3 and above. I cannot seem to find this info in a message header
in TB 2 though. Anyone know of an easy way to get ahold of this info in
TB2? Thanks
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Getting at the BCC List in TB2?

Simon Paquet-2
[hidden email] wrote on 13. Feb 2012:

> It seems that I get easy access to the BCC list from a message's header
> in TB 3 and above. I cannot seem to find this info in a message header
> in TB 2 though. Anyone know of an easy way to get ahold of this info in
> TB2?

Is there a reason for you putting much effort into supporting a release
that has been out-of-date for more than two years, has a usage share of
roughly 2% nowadays and hasn't seen a security update for nearly two
years?

Cya
Simon

_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Getting at the BCC List in TB2?

whitedavidp
Hi Simon. The main reason is ME. I still see no compelling reason to use
TB 3+. And as I follow the newsgroups after every release of a new TB, I
am glad I have stayed-put. Of course, I have several addon users who
also still use TB 2.x for similar reasons. In fact, the person
requesting this new feature is one of those.

So... can you help answer my question? Thanks

Simon Paquet wrote:

> [hidden email] wrote on 13. Feb 2012:
>
>> It seems that I get easy access to the BCC list from a message's
>> header in TB 3 and above. I cannot seem to find this info in a message
>> header in TB 2 though. Anyone know of an easy way to get ahold of this
>> info in TB2?
>
> Is there a reason for you putting much effort into supporting a release
> that has been out-of-date for more than two years, has a usage share of
> roughly 2% nowadays and hasn't seen a security update for nearly two
> years?
>
> Cya
> Simon
>
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Getting at the BCC List in TB2?

Jim Wood-2
[hidden email] wrote:

> Hi Simon. The main reason is ME. I still see no compelling reason to use
> TB 3+. And as I follow the newsgroups after every release of a new TB, I
> am glad I have stayed-put. Of course, I have several addon users who
> also still use TB 2.x for similar reasons. In fact, the person
> requesting this new feature is one of those.
>
> So... can you help answer my question? Thanks
>
> Simon Paquet wrote:
>> [hidden email] wrote on 13. Feb 2012:
>>
>>> It seems that I get easy access to the BCC list from a message's
>>> header in TB 3 and above. I cannot seem to find this info in a
>>> message header in TB 2 though. Anyone know of an easy way to get
>>> ahold of this info in TB2?
>>
>> Is there a reason for you putting much effort into supporting a release
>> that has been out-of-date for more than two years, has a usage share of
>> roughly 2% nowadays and hasn't seen a security update for nearly two
>> years?
>>
>> Cya
>> Simon
>>
I also continue to use TB 2 and BCC's display in my "sent" message
headers preview pane and on using Ctrl+U.

--
Regards

Jim Wood, Brisbane
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Getting at the BCC List in TB2?

Simon Paquet-2
In reply to this post by whitedavidp
[hidden email] wrote on 14. Feb 2012:

>>> It seems that I get easy access to the BCC list from a message's
>>> header in TB 3 and above. I cannot seem to find this info in a
>>> message header in TB 2 though. Anyone know of an easy way to get
>>> ahold of this info in TB2?
>>
>> Is there a reason for you putting much effort into supporting a
>> release that has been out-of-date for more than two years, has a
>> usage share of roughly 2% nowadays and hasn't seen a security
>> update for nearly two years?
>
> Hi Simon. The main reason is ME.

That is a pretty good reason :-)

> I still see no compelling reason to use TB 3+. And as I follow the
> newsgroups after every release of a new TB, I am glad I have
> stayed-put.

The above being said, I really don't know what makes you stay at TB2.
At least for my use cases and that of other people I know, the current
TB releases are faster, less crash-prone and more feature-rich than
TB2. Add to that the better extendability for addon authors (which you
already mentioned), the better security and the ability to get bugs
fixed that you care about (nobody is working on TB2 code anymore)
that seems like a pretty good reason to do the jump.

As for the feedback here in the newsgroups:

- a lot of it has died down (e.g. the complaints about the slow new
  search feature) as related bugs have been fixed.
- This newsgroup is not a good indicator of user satisfaction as this
  is a pretty problem-oriented area, not an area where users give a
  lot of praise.

I would agree that TB3 was a pretty bad release, but all the big issues
with that were already fixed with 3.1. The followup releases have not
dramatically improved the user experience but have fixed a lot of
rough edges.

For me the security issue is already the main dealbreaker. When I
was still on the Lightning team, it was the main reason (together
with resources) for us abandoning TB2 and moving to the new releases.

> So... can you help answer my question? Thanks

Unfortunately not. That area of code saw massive changes between TB2
and TB3. It may very well be that one of the reasons for those changes
was increased extendability, meaning that what you want is not easily
done in TB2.

--
Simon
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird