mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 03:33:11 +01:00
Let's make channellen parameterizable as well.
This commit is contained in:
parent
a12d65160e
commit
a0c0d833e3
@ -120,18 +120,19 @@ def isNick(s, strictRfc=True, nicklen=None):
|
||||
ret = len(s) <= nicklen
|
||||
return ret
|
||||
else:
|
||||
# XXX special values to isChannel?
|
||||
return not isChannel(s) and \
|
||||
not isUserHostmask(s) and \
|
||||
not ' ' in s and not '!' in s
|
||||
|
||||
def isChannel(s, chantypes='#&+!'):
|
||||
def isChannel(s, chantypes='#&+!', channellen=50):
|
||||
"""Returns True if s is a valid IRC channel name."""
|
||||
return s and \
|
||||
len(s) <= 50 and \
|
||||
',' not in s and \
|
||||
'\x07' not in s and \
|
||||
s[0] in chantypes and \
|
||||
len(s.split()) == 1
|
||||
',' not in s and \
|
||||
'\x07' not in s and \
|
||||
s[0] in chantypes and \
|
||||
len(s) <= channellen and \
|
||||
len(s.split(None, 1)) == 1
|
||||
|
||||
_patternCache = {}
|
||||
def _hostmaskPatternEqual(pattern, hostmask):
|
||||
|
Loading…
Reference in New Issue
Block a user