revert sieve to version without broken caching

This commit is contained in:
Ryan Hitchman 2010-02-13 14:03:19 -07:00
parent 9d139d8760
commit 51e24dadb5
1 changed files with 8 additions and 13 deletions

View File

@ -14,21 +14,16 @@ def sieve_suite(bot, input, func, args):
if input.nick.lower()[-3:] == 'bot' and args.get('ignorebots', True):
return None
regex = args.get('re')
if not regex:
hook = args.get('hook', r'(.*)')
hook = args.get('hook', r'(.*)')
if args.get('prefix', True):
if input.chan == input.nick: # private message, prefix not required
prefix = r'^(?:[.!]?|'
else:
prefix = r'^(?:[.!]|'
hook = prefix + input.conn.nick + r'[:,]*\s)' + hook
if args.get('prefix', True):
if input.chan == input.nick: # private message, prefix not required
prefix = r'^(?:[.!]?|'
else:
prefix = r'^(?:[.!]|'
hook = prefix + input.conn.nick + r'[:,]*\s)' + hook
regex = re.compile(hook, flags=re.I)
args['re'] = regex
input.re = regex.match(input.msg)
input.re = re.match(hook, input.msg, flags=re.I)
if input.re is None:
return None