mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-30 06:49:24 +01:00
I didn't like the idea of supybot being able to time travel
This commit is contained in:
parent
d508b19347
commit
34555c51ff
@ -230,12 +230,15 @@ class Channel(callbacks.Privmsg):
|
|||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
length = int(length or 0)
|
length = int(length or 0)
|
||||||
|
if length < 0:
|
||||||
|
irc.error('Ban length must be a non-negative integer.')
|
||||||
|
return
|
||||||
except ValueError:
|
except ValueError:
|
||||||
if reason:
|
if reason:
|
||||||
reason = ' '.join((length, reason))
|
reason = ' '.join((length, reason))
|
||||||
length = 0
|
length = 0
|
||||||
else:
|
else:
|
||||||
irc.error('Ban length must be a valid integer.')
|
irc.error('Ban length must be a non-negative integer.')
|
||||||
return
|
return
|
||||||
if not reason:
|
if not reason:
|
||||||
reason = msg.nick
|
reason = msg.nick
|
||||||
|
@ -123,6 +123,7 @@ class ChannelTestCase(ChannelPluginTestCase, PluginDocumentation):
|
|||||||
prefix='foobar!user@host.domain.tld'))
|
prefix='foobar!user@host.domain.tld'))
|
||||||
self.assertError('kban foobar')
|
self.assertError('kban foobar')
|
||||||
self.irc.feedMsg(ircmsgs.op(self.channel, self.irc.nick))
|
self.irc.feedMsg(ircmsgs.op(self.channel, self.irc.nick))
|
||||||
|
self.assertError('kban foobar -1')
|
||||||
self.assertBan('kban foobar', '*!*@*.domain.tld')
|
self.assertBan('kban foobar', '*!*@*.domain.tld')
|
||||||
self.assertBan('kban --exact foobar', 'foobar!user@host.domain.tld')
|
self.assertBan('kban --exact foobar', 'foobar!user@host.domain.tld')
|
||||||
self.assertBan('kban --host foobar', '*!*@host.domain.tld')
|
self.assertBan('kban --host foobar', '*!*@host.domain.tld')
|
||||||
|
Loading…
Reference in New Issue
Block a user