mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 11:12:47 +01:00
Prevent the 'hostmask' converter from returning '*!*@*' while 'foo!*@*' was given.
This commit is contained in:
parent
8ab33bccb4
commit
b7bc11deea
@ -205,11 +205,19 @@ class ChannelTestCase(ChannelPluginTestCase):
|
|||||||
|
|
||||||
def testIgnore(self):
|
def testIgnore(self):
|
||||||
orig = conf.supybot.protocols.irc.banmask()
|
orig = conf.supybot.protocols.irc.banmask()
|
||||||
|
def ignore(given, expect=None):
|
||||||
|
if expect is None:
|
||||||
|
expect = given
|
||||||
|
self.assertNotError('channel ignore add %s' % given)
|
||||||
|
self.assertResponse('channel ignore list', "'%s'" % expect)
|
||||||
|
self.assertNotError('channel ignore remove %s' % expect)
|
||||||
|
self.assertRegexp('channel ignore list', 'not currently')
|
||||||
try:
|
try:
|
||||||
|
ignore('foo!bar@baz', '*!bar@baz')
|
||||||
|
ignore('foo!*@*')
|
||||||
conf.supybot.protocols.irc.banmask.setValue(['exact'])
|
conf.supybot.protocols.irc.banmask.setValue(['exact'])
|
||||||
self.assertNotError('channel ignore add foo!bar@baz')
|
ignore('foo!bar@baz')
|
||||||
self.assertResponse('channel ignore list', "'foo!bar@baz'")
|
ignore('foo!*@*')
|
||||||
self.assertNotError('channel ignore remove foo!bar@baz')
|
|
||||||
self.assertError('ban add not!a.hostmask')
|
self.assertError('ban add not!a.hostmask')
|
||||||
finally:
|
finally:
|
||||||
conf.supybot.protocols.irc.banmask.setValue(orig)
|
conf.supybot.protocols.irc.banmask.setValue(orig)
|
||||||
|
@ -946,6 +946,9 @@ class Banmask(registry.SpaceSeparatedSetOfStrings):
|
|||||||
bhost = host
|
bhost = host
|
||||||
elif option == 'exact':
|
elif option == 'exact':
|
||||||
return hostmask
|
return hostmask
|
||||||
|
if (bnick, buser, bhost) == ('*', '*', '*') and \
|
||||||
|
ircutils.isUserHostmask(hostmask):
|
||||||
|
return hostmask
|
||||||
return ircutils.joinHostmask(bnick, buser, bhost)
|
return ircutils.joinHostmask(bnick, buser, bhost)
|
||||||
|
|
||||||
registerChannelValue(supybot.protocols.irc, 'banmask',
|
registerChannelValue(supybot.protocols.irc, 'banmask',
|
||||||
|
Loading…
Reference in New Issue
Block a user