mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-02 17:29:22 +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
|
ret = len(s) <= nicklen
|
||||||
return ret
|
return ret
|
||||||
else:
|
else:
|
||||||
|
# XXX special values to isChannel?
|
||||||
return not isChannel(s) and \
|
return not isChannel(s) and \
|
||||||
not isUserHostmask(s) and \
|
not isUserHostmask(s) and \
|
||||||
not ' ' in s and not '!' in s
|
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."""
|
"""Returns True if s is a valid IRC channel name."""
|
||||||
return s and \
|
return s and \
|
||||||
len(s) <= 50 and \
|
',' not in s and \
|
||||||
',' not in s and \
|
'\x07' not in s and \
|
||||||
'\x07' not in s and \
|
s[0] in chantypes and \
|
||||||
s[0] in chantypes and \
|
len(s) <= channellen and \
|
||||||
len(s.split()) == 1
|
len(s.split(None, 1)) == 1
|
||||||
|
|
||||||
_patternCache = {}
|
_patternCache = {}
|
||||||
def _hostmaskPatternEqual(pattern, hostmask):
|
def _hostmaskPatternEqual(pattern, hostmask):
|
||||||
|
Loading…
Reference in New Issue
Block a user