[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Filters
On Sun, 2003-03-23 at 19:06, Ricardo Bugalho wrote:
> On Sat, 2003-03-22 at 20:39, David Oftedal wrote:
> > I've noticed there's an option to strip all mIRC colors.
> >
> > However, wouldn't it be nice to include a "filter all lines containing
> > colors", and "filter all lines containing string: [ ]" so
> > we could actually chat in all those fserve channels.
> >
>
> You can do that with plugins/scripts, by making the event handler return
> XCHAT_EAT_XCHAT or XCHAT_EAT_ALL.
> Take a look at http://raxx7.no.sapo.pt/xchat2/nospam.py.txt to see an
> example in Python.
Two things, one because I don't normally do anything with python that
doesn't involve a gun to my head...
1. What are XCHAT_EAT_XCHAT and XCHAT_EAT_ALL equivalent to, and what
does EAT stand for there?
2. The following from the URL above seems very unsafe...
if re.search('#', noColor) or \
re.search('http://', noColor, re.I) or \
re.search('www\.', noColor, re.I):
xchat.command('RAW NOTICE %s :Your message has been classified as spam '\
'and ignored!' % sourceNick)
return xchat.EAT_XCHAT
I've not had time to audit through X-Chat's code to see exactly how it handles
avoiding flooding the server, but with other clients in the past /raw commands
typically bypassed throttling routines (for good reason) This could be
problematic... I'd like to suggest simply storing a epoch seconds in a global
variable before exiting this subroutine, and on entry comparing to see if it's
the same as the current time to decide whether or not to bother warning the
user their message has been refused.
--
XChat-discuss: mailing list for XChat users
Archive: http://mail.nl.linux.org/xchat-discuss/