Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Custom Filters

26 views
Skip to first unread message

Onno Ekker

unread,
Jun 28, 2012, 8:50:44 AM6/28/12
to
Hi,

I'm trying to add Custom Filters to my extension, but I run into
problems. I want the Filters to be only available for Inbox/mail and
thought I could use the isValidForType function for that.

>From what I understand the type should be set to any value defined in
nsMsgFilterCore.idl, but I only get the value 0 for both filters on a
mail folder as for filters on a news account.

I also notice that when I go to the Message Filters definition that the
function isValidForType is called twice. I don't understand why this is
happening.

isValidForType has scope as its second parameter, but I cannot find any
documentation on that either...

Can someone please help me with the problems mentioned above me in
adding custom filters to my extension?

Onno

Onno Ekker

unread,
Jun 28, 2012, 1:46:36 PM6/28/12
to
Op 28-6-2012 14:50 schreef Onno Ekker het volgende:
I found the scope is defined in nsMsgSearchCore.idl and it looks like
this can be used too to determine if it's a news filter.

I still would like to know why type is always zero and why
isValidForType is called twice.

Onno

Kent James

unread,
Jul 2, 2012, 10:30:50 AM7/2/12
to
On 6/28/2012 10:46 AM, Onno Ekker wrote:
> I still would like to know why type is always zero and why
> isValidForType is called twice.

The custom filter code was added to the core Thunderbird by me many
years ago, and I am probably its biggest user in my FiltaQuilla extension.

But I don't really know the answer to your questions. I spent a couple
of minutes searching through the raw code using
http://mxr.mozilla.org/comm-aurora/, but that did not provide any
obvious answers to your questions. I doubt if anyone can answer your
questions short of instrumenting and debugging in the core code.

I can tell you that type comes from a global set in the filter editor.

rkent

Onno Ekker

unread,
Jul 2, 2012, 2:13:23 PM7/2/12
to
Hi Kent,

Thanks for your answer. I think the isValidForType function being called
twice might have been my mistake. I don't see it anymore in the latest
version of my extension.

When toying around some more I found out that type is set depending on
when the filters are applied. I haven't found any real logic in the
returned values yet though :-)

Onno
0 new messages