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): if input.nick.lower()[-3:] == 'bot' and args.get('ignorebots', True):
return None return None
regex = args.get('re') hook = args.get('hook', r'(.*)')
if not regex:
hook = args.get('hook', r'(.*)')
if args.get('prefix', True): if args.get('prefix', True):
if input.chan == input.nick: # private message, prefix not required if input.chan == input.nick: # private message, prefix not required
prefix = r'^(?:[.!]?|' prefix = r'^(?:[.!]?|'
else: else:
prefix = r'^(?:[.!]|' prefix = r'^(?:[.!]|'
hook = prefix + input.conn.nick + r'[:,]*\s)' + hook hook = prefix + input.conn.nick + r'[:,]*\s)' + hook
regex = re.compile(hook, flags=re.I) input.re = re.match(hook, input.msg, flags=re.I)
args['re'] = regex
input.re = regex.match(input.msg)
if input.re is None: if input.re is None:
return None return None