mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 20:52:42 +01:00
plugins/URL: Make URL.last case-insensitive.
This commit is contained in:
parent
9cb1669b5f
commit
e9fd59dc45
@ -105,6 +105,7 @@ class URL(callbacks.Plugin):
|
|||||||
f = None
|
f = None
|
||||||
nolimit = False
|
nolimit = False
|
||||||
for (option, arg) in optlist:
|
for (option, arg) in optlist:
|
||||||
|
arg = arg.lower()
|
||||||
if option == 'nolimit':
|
if option == 'nolimit':
|
||||||
nolimit = True
|
nolimit = True
|
||||||
elif option == 'from':
|
elif option == 'from':
|
||||||
@ -112,16 +113,16 @@ class URL(callbacks.Plugin):
|
|||||||
return ircutils.strEqual(record.by, arg)
|
return ircutils.strEqual(record.by, arg)
|
||||||
elif option == 'with':
|
elif option == 'with':
|
||||||
def f(record, arg=arg):
|
def f(record, arg=arg):
|
||||||
return arg in record.url
|
return arg in record.url.lower()
|
||||||
elif option == 'without':
|
elif option == 'without':
|
||||||
def f(record, arg=arg):
|
def f(record, arg=arg):
|
||||||
return arg not in record.url
|
return arg not in record.url.lower()
|
||||||
elif option == 'proto':
|
elif option == 'proto':
|
||||||
def f(record, arg=arg):
|
def f(record, arg=arg):
|
||||||
return record.url.startswith(arg)
|
return record.url.lower().startswith(arg)
|
||||||
elif option == 'near':
|
elif option == 'near':
|
||||||
def f(record, arg=arg):
|
def f(record, arg=arg):
|
||||||
return arg in record.near
|
return arg in record.near.lower()
|
||||||
if f is not None:
|
if f is not None:
|
||||||
predicates.append(f)
|
predicates.append(f)
|
||||||
def predicate(record):
|
def predicate(record):
|
||||||
|
Loading…
Reference in New Issue
Block a user