mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 19:22:45 +01:00
Correct our ValidChannel checking (no , in channel key) and provide a little
more information in supybot-wizard if there's an error when adding channels.
This commit is contained in:
parent
b196d3fc21
commit
c5db149f65
@ -383,7 +383,8 @@ def main():
|
|||||||
# FIXME: say which ones weren't channels.
|
# FIXME: say which ones weren't channels.
|
||||||
output("""Not all of those are valid IRC channels. Be sure to
|
output("""Not all of those are valid IRC channels. Be sure to
|
||||||
prefix the channel with # (or +, or !, or &, but no one uses
|
prefix the channel with # (or +, or !, or &, but no one uses
|
||||||
those channels, really).""")
|
those channels, really). Be sure the channel key (if you are
|
||||||
|
supplying one) does not contain a comma.""")
|
||||||
else:
|
else:
|
||||||
conf.supybot.channels.setValue([])
|
conf.supybot.channels.setValue([])
|
||||||
|
|
||||||
|
@ -168,7 +168,13 @@ class ValidChannel(registry.String):
|
|||||||
"""Value must be a valid IRC channel name."""
|
"""Value must be a valid IRC channel name."""
|
||||||
def setValue(self, v):
|
def setValue(self, v):
|
||||||
if ',' in v:
|
if ',' in v:
|
||||||
(channel, _) = v.split(',', 1)
|
# To prevent stupid users from: a) trying to add a channel key
|
||||||
|
# with a comma in it, b) trying to add channels separated by
|
||||||
|
# commas instead of spaces
|
||||||
|
try:
|
||||||
|
(channel, _) = v.split(',')
|
||||||
|
except ValueError:
|
||||||
|
self.error()
|
||||||
else:
|
else:
|
||||||
channel = v
|
channel = v
|
||||||
if not ircutils.isChannel(channel):
|
if not ircutils.isChannel(channel):
|
||||||
|
Loading…
Reference in New Issue
Block a user