Re: EB-lite feature requests

Meredydd Luff <[email protected]>
Newsgroups gmane.network.everybuddy.user
Message-ID <03030914025601.09627@rhodium>
This is exactly one of the applications I envisioned for the filter API. I 
believe that Yahoo implements it correctly, although I'm afraid it's not yet 
documented. Basic idea is that you register a filter function onto a 
particular chain (all functions/constants defined in message_parse.h). There 
are three filter chains you need to know about:

EB_FILTER_IN filters incoming messages
EB_PREFILTER_OUT filters outgoing messages *before* they get displayed as 
"sent"
EB_POSTFILTER_OUT filters outgoing messages *after* they get displayed as 
"sent"

The split output chains are for a good reason. For example, if one wanted to 
reimplement the "rainbow" functionality of old EB, it would go in the 
prefilter chain, because you'd want to see the latered version of the message 
in the conversation window. An encryption plugin, however, would want to go 
in the postfilter chain, because the user would want to see the plaintext 
version of the message, although the version actually sent was encrypted.

The "context" pointer passed to the filter functions is (for these three 
chains) just a pointer to the eb_account object (if someone's messaging you 
out of the blue, one of these will automatically be created in your Unknown 
group). The "handle" attribute is probably the one you should be looking at 
here, although you could look at the message content too if you want. If you 
return NULL (remember to free() the message if you do!) from a filter 
function, the message gets cancelled. This is the effect you probably want 
for a spam-filter function. Otherwise, you can just return the same pointer 
you're given.

Hope this helps,
Meredydd

On Sunday 09 March 2003 04:47, Geoff Cummins wrote:
> One problem I have is random spam messages from ppl on yahoo, though I
> noticed a lot of them have "pic_in_profile" in their handle, so I was
> wondering if we could add some way of doing wildcard/masked ignores like
> *pic_on_profile* etc..  Though not being famliar with how the protocols
> work I have no idea how practical this would be.

-- 

MSN Developer, Everybuddy project
http://www.everybuddy.com/

MSN:     [email protected]
AIM:     blip109
Yahoo:   modula7
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.