mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-26 04:39:26 +01:00
Remove '+' from the default chantypes.
It's more likely to be a statusmsg than chantype.
This commit is contained in:
parent
696254ff1b
commit
d4cac026d4
@ -143,7 +143,7 @@ def areNicks(s, strictRfc=True, nicklen=None):
|
||||
nick = functools.partial(isNick, strictRfc=strictRfc, nicklen=nicklen)
|
||||
return all(map(nick, s.split(',')))
|
||||
|
||||
def isChannel(s, chantypes='#&+!', channellen=50):
|
||||
def isChannel(s, chantypes='#&!', channellen=50):
|
||||
"""s => bool
|
||||
Returns True if s is a valid IRC channel name."""
|
||||
return s and \
|
||||
@ -153,13 +153,13 @@ def isChannel(s, chantypes='#&+!', channellen=50):
|
||||
len(s) <= channellen and \
|
||||
len(s.split(None, 1)) == 1
|
||||
|
||||
def areChannels(s, chantypes='#&+!',channellen=50):
|
||||
def areChannels(s, chantypes='#&!', channellen=50):
|
||||
"""Like 'isChannel(x)' but for comma-separated list."""
|
||||
chan = functools.partial(isChannel, chantypes=chantypes,
|
||||
channellen=channellen)
|
||||
return all(map(chan, s.split(',')))
|
||||
|
||||
def areReceivers(s, strictRfc=True, nicklen=None, chantypes='#&+!',
|
||||
def areReceivers(s, strictRfc=True, nicklen=None, chantypes='#&!',
|
||||
channellen=50):
|
||||
"""Like 'isNick(x) or isChannel(x)' but for comma-separated list."""
|
||||
nick = functools.partial(isNick, strictRfc=strictRfc, nicklen=nicklen)
|
||||
|
@ -75,11 +75,13 @@ class FunctionsTestCase(SupyTestCase):
|
||||
def testIsChannel(self):
|
||||
self.failUnless(ircutils.isChannel('#'))
|
||||
self.failUnless(ircutils.isChannel('&'))
|
||||
self.failUnless(ircutils.isChannel('+'))
|
||||
self.failIf(ircutils.isChannel('+'))
|
||||
self.failUnless(ircutils.isChannel('+', chantypes='#&+!'))
|
||||
self.failUnless(ircutils.isChannel('!'))
|
||||
self.failUnless(ircutils.isChannel('#foo'))
|
||||
self.failUnless(ircutils.isChannel('&foo'))
|
||||
self.failUnless(ircutils.isChannel('+foo'))
|
||||
self.failIf(ircutils.isChannel('+foo'))
|
||||
self.failUnless(ircutils.isChannel('+foo', chantypes='#&+!'))
|
||||
self.failUnless(ircutils.isChannel('!foo'))
|
||||
self.failIf(ircutils.isChannel('#foo bar'))
|
||||
self.failIf(ircutils.isChannel('#foo,bar'))
|
||||
|
Loading…
Reference in New Issue
Block a user